Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Green

Calculating whats inside camera FOV

This topic is 5931 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

This is a total newb question but, .......... I know my camera angle on the XZ axis'' (at angle zero my camera points directly into the positive Z axis, at angle 90, the positive X axis). I know the position of my camera as well as the position of objects. My FOV is Pi / 4 radians and my veiwing distance is 1000. How do I figure out if objects are within my feild of view, so I know if to render them?

Share this post


Link to post
Share on other sites
Advertisement
it actually has little to do with SDK...you just process the bounding boxes to decide what do draw and then draw using which ever SDK you are using...only difference may be is how to find the planes in the view frustum (which is only few lines of code).

Share this post


Link to post
Share on other sites
I have a PDF paper that shows you how to extract the frustum planes in DirectX. I can’t post a link because I forgot where I got the paper. So I just emailed it to you.

After extracting the frustum planes, find the dot product of the position of the object in question and each plane. If the result is positive for all planes, then the object is in view. (If you want to save time, you might choose to compare against just the left and right planes.)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!