Jump to content
  • Advertisement


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


HOW: Viewable Rectangle at a given distance via the Frustum?

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

Given the six planes of the Frustum how would one go about getting the four points of the viewable rectangle at some distance? And ho about the four intersections of a plane which cuts through the left, top, right, and bottom planes? Any help would be appreciated, Ranger

Share this post

Link to post
Share on other sites
Knowing the near clipping plane''s dimensions and the near clipping distance, it seems to me you could do it with a little bit of trigonometry and geometry. First, "looking" at the frustum from the top, calculate the FOV angle and then you should be able to figure out all four angles and all four sides of the trapezoid formed by the shape of the frustum. Knowing the distance between the two clipping planes and the distance to the plane you want to find the dimensions of, it''s some trivial trig to calculate.

Follow a similar process for the height. There''s probably a much easier way, I just tend to think geometrically

Come to think of it, you could probably do it really easily with one of those unprojection functions people are always talking about.

Share this post

Link to post
Share on other sites
Omaha, wouldn''t similar triangles solve the same thing without trigonometry?

\ |
x -> \____| _
\ | |
left -> \__| _ |_ depth
\ | |_ near |
\| _| _|

left/x = near/depth
x = (depth*width)/near

Same thing can be done for right, top and bottom.
Of course, this assumes that the frustrum is symmetrical along Z-axis.

Dirk =[Scarab]= Gerrits

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!