BangTao Posted January 11, 2017 Share Posted January 11, 2017 I'm preliminary study on Babylon,and there's a question: suppose that there is a color cube in the coordinate system,i wanna define a point object,this point can be set (x,y,z) and Corresponds to a point on the cube.and i can obtain the cube's color by this point..... so ...is there any method that can make it? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 11, 2017 Share Posted January 11, 2017 Hello, you can create a ray from this point and do a scene.pickWithRay. This will return a pickInfo. If the box is hit, you can then use something similar to that: https://github.com/BabylonJS/Babylon.js/blob/master/src/Collisions/babylon.pickingInfo.ts#L62 But instead of reading UV you can read vertex color Wingnut 1 Quote Link to comment Share on other sites More sharing options...
BangTao Posted January 12, 2017 Author Share Posted January 12, 2017 ah,Thank u Deltakosh,i've tried that,seem that i can't get the inside vertex's attr.or maybe i didn't know how to use Ray correctly.but I'm working on it ~!!Thx Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 12, 2017 Share Posted January 12, 2017 As usual I am not very good at working out what people actually want to do, though others seem to pick up on these things. Do you mean some thing like where the (x, y, z) just tells you which cube and you want to find the color of the cube or something like where the (x, y, z) is a particular point on the cube and you want to know the exact color at (x, y, z) or something else. Diagrams are worth lots of words. Quote Link to comment Share on other sites More sharing options...
BangTao Posted January 12, 2017 Author Share Posted January 12, 2017 20 minutes ago, JohnK said: As usual I am not very good at working out what people actually want to do, though others seem to pick up on these things. Do you mean some thing like where the (x, y, z) just tells you which cube and you want to find the color of the cube or something like where the (x, y, z) is a particular point on the cube and you want to know the exact color at (x, y, z) or something else. Diagrams are worth lots of words. yes,,thank u JohnK,and it's like the second picture,but that point isn't on the cube, Diagram did help more!? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.