• Popular Now

• 13
• 27
• 9
• 9
• 21

Archived

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

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

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

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 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 on other sites
Omaha, wouldn''t similar triangles solve the same thing without trigonometry?
     \     |x ->  \____|           _       \   |            |left -> \__|  _         |_ depth         \ |   |_ near  |          \|  _|       _|left/x = near/depthx = (depth*width)/nearSame thing can be done for right, top and bottom.Of course, this assumes that the frustrum is symmetrical along Z-axis.    Dirk =[Scarab]= Gerrits



...

Damn you.