Hi there, Im looking into rays and wanted to know if you can use a ray to get the coordinates on the surface of a mesh, rather then getting the coordinates of the scene or picking an entire mesh.
For example, if there were a plane mesh in the scene, is there a way of checking what part of that plane had been picked, ie the top-right corner, even if the plane mesh were to move within the scene.
I notice on this page theres a brief mention about using the Ray class to get local coordinates but it seems the documentation is unfinished (its a small section thats duplicated twice on the page and doesn’t have much context)
(under the multi-pick section)
I’m suspect the mesh may have to be subdivided to get this effect, if it’s possible at all, but any suggestions welcome
ok, soo after some playing around and slightly confusing results ive stumbled into another issue of what I want to do.
It seems like the Barycentric coordinates given by bv/bu are relative to the triangles of the mesh (the simplex…?), and so im getting these readings (from the cube in the above playground):
Any idea how this could be achieved? is there a way to get the particular triangle thats being picked and map the data somehow to give a continuous value?
Caveat is that a single face wont map from 0-1 (or maybe would if the uvs were changed, im not sure) but it doesn’t crossover in the middle and gives a linear value I can use (in the playground above its like 0.4-0.6 or so on the front face, continuing wrapping around the cube).
Here it is for posterity using a plane (which does map from 0 to1). Might be good for graph-type things. Or 3D darts