Jump to content

How can i get a special point's color from coordinate system(xyz) by define a point


BangTao
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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 Colored-Cubes.jpg where the (x, y, z) just tells you which cube and you want to find the color of the cube

 

or

something like RGB_Colorcube_Corner_White.pngwhere 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.

Link to comment
Share on other sites

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 Colored-Cubes.jpg where the (x, y, z) just tells you which cube and you want to find the color of the cube

 

or

something like RGB_Colorcube_Corner_White.pngwhere 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!?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...