I'm currently using the Unity Plane object to create an infinite plane, and to cast several rays against it. Like so:
1) whether it has hit the plane or not, and
2) the distance, in case it has a hit
So I cast a ray from my camera, and it hits my plane. However, with just the distance information I cannot calculate where in 3D space each ray hits.
What mathematical calculations can I use in order to calculate the 3D intersectionpoints of each ray?
asked Jan 25 '11 at 11:05 PM
Basically if you cast a ray you normally have a starting point and a direction vector. if you have the distance you hit something just add the normalized direction vector multiplied by the distance to your starting point. That's it. But the Ray class in Unity have a special function that will do that for you: Ray.GetPoint()
answered Jan 25 '11 at 11:26 PM