Finding camera view intersection w/ the X-Z plane?
Hi,
I am trying to find out the 4 points that intersect with the X-Z from a camera. Drew up a little diagram to explain:
The red dots are the points I want to find on the x-z plane. The black dot is the position of the camera and the black lines are the way its looking. Any suggestions or links to how this is done??
I have access to all the necessary information such as the view, projection matrix and the camera position, camera target.
Thanks
You have the camera position, look-at target, and both vertical and horizontal FOV, right? So use trivial ray-plane intersection down the edges of the frustrum.
Intersection; http://local.wasp.uwa.edu.au/~pbourke/geometry/
Intersection; http://local.wasp.uwa.edu.au/~pbourke/geometry/
ah makes sense. problem is tho how do you find the edges of the frustum as its just defined by planes?
You'll just to figure out the corners of your frustum. This is easy to do...this tutorial shows you how to do it. You can just calculate the near or far corners, then from those you can get 4 rays by doing corner - cameraPos. Then you just have to do ray-plane intersection with the plane Y = 0, and you'll get the 4 points of intersection.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement