Archived

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

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.

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 on other sites
Try this:

http://www.markmorley.com/opengl/frustumculling.html

It seems a bit complex for a newbie like you or I, but it''ll help. It has a useful example program too.

Share on other sites
Good article.

Anyone know of a DirectX one?

Share on other sites
Doh,

Guess I should have checked the SDK sooner,.....

Share on other sites
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 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.)

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• Forum Statistics

• Total Topics
633735
• Total Posts
3013593
×