Jump to content
  • Advertisement
Sign in to follow this  
Nextgenneo

Finding camera view intersection w/ the X-Z plane?

This topic is 3495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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/

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!