Can any one help me to get left, right, bottom, top, near and far boundary values from projection matrix44?
The projection matrix is typically a scale and perspective projection. The projection transformation converts the viewing frustum into a cuboid shape. The near end of the viewing frustum is smaller than the far end, which has the effect of expanding objects that are near to the camera.
The perspective projection frustum is defined by the parameters θ, n, f, h and the width of the view (near) plane. An anamorphic image appears distorted from all but a few viewpoints. They have been studied by artists and architects since the early fifteenth century.
An isometric view of an object can be obtained by choosing the viewing direction such that the angles between the projections of the x, y, and z axes are all the same, or 120°.
Here are the resolutions of the equation systems Christian Rau referred to :
For an orthographic matrix :
near = (1+m34)/m33;
far = -(1-m34)/m33;
bottom = (1-m24)/m22;
top = -(1+m24)/m22;
left = -(1+m14)/m11;
right = (1-m14)/m11;
For a perspective matrix :
near = m34/(m33-1);
far = m34/(m33+1);
bottom = near * (m23-1)/m22;
top = near * (m23+1)/m22;
left = near * (m13-1)/m11;
right = near * (m13+1)/m11;
You can replace the values m11, m12, etc., by the formulas defined in the documentation for glOrtho and glFrustum to check it's correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With