Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I would like to define a 3D point and a 3D vector, then shoot a ray from that point and get back a 3D point with the coordonate of a mesh point hit by this ray.

I can do hittesting but only with 2D points (generaly coresponding to the mouse position), but i cannot find a way to do it with 3D points.

If any body as a hint, it would be gladly appreciated.
Thanks
Posted
Updated 16-Sep-15 23:58pm
v2
Comments
Kenneth Haugland 17-Sep-15 6:09am    
So, Ray tracing?
Laurent Chougrani 17-Sep-15 7:36am    
Yes I've looked into it, but can't find a proper way to do so with 3D points.
Kenneth Haugland 17-Sep-15 20:05pm    
https://www.google.no/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=distance%20between%20a%20point%20and%20plane
Kenneth Haugland 17-Sep-15 20:06pm    
Its what you'll need to calculate. IIRC this is usually done using determinant of a matrix.
Laurent Chougrani 18-Sep-15 2:30am    
that's not what i want, distance from a point to a plane is calculate throught the normal. I need to return the triangle or point that was hit by the ray no matter the orientation of the surface... I'm sure there is a way embeded in WPF or helixtoolkit.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900