width of a frustum at a given distance from the near plane
Posted
by structolite
on Stack Overflow
See other posts from Stack Overflow
or by structolite
Published on 2010-04-10T03:16:12Z
Indexed on
2010/04/10
3:23 UTC
Read the original article
Hit count: 400
I'm using CML to manage the 3D math in an OpenGL-based interface project I'm making for work. I need to know the width of the viewing frustum at a given distance from the eye point, which is kept as a part of a 4x4 matrix that represents the camera. My goal is to position gui objects along the apparent edge of the viewport, but at some distance into the screen from the near clipping plane.
CML has a function to extract the planes of the frustum, giving them back in Ax + By + Cz + D = 0 form. This frustum is perpendicular to the camera, which isn't necessarily aligned with the z axis of the perspective projection.
I'd like to extract x and z coordinates so as to pin graphical elements to the sides of the screen at different distances from the camera. What is the best way to go about doing it?
Thanks!
© Stack Overflow or respective owner