I use CML to control 3D math in an OpenGL-based interface project that I make for work. I need to know the width of the viewing truncation at a given distance from the eye point, which is stored as part of the 4x4 matrix that represents the camera. My goal is to position gui objects along the visible edge of the viewport, but at some distance from the screen from the near clipping plane.
CML has a function to extract the planes of the truncated cone, returning them in the form Ax + By + Cz + D = 0. This truncation is perpendicular to the camera, which does not necessarily coincide with the z axis of the perspective projection.
I would like to select the x and z coordinates in order to align the graphic elements on the sides of the screen at different distances from the camera. What is the best way to do this?
Thank!
source
share