# Projection Matrix

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

## Recommended Posts

I am trying to extract the values used to create a projection matrix. I found the following MSDN page and derived my math from there. Everything comes out correctly, except the far plane. The far plane is very close, but has an error of around .07 . I assume that is due to floating point error? although only one calculation has been done on the matrix. Is there a more accurate way to get that value? I also, don't understand how to get the Fov from the matrix.
   // Disassemble the projection matrix
float q         = origProjection._33;
float nearPlane = origProjection._43 / -q;
float farPlane  = -q * nearPlane / (1.0f - q);
float width     = 2.0f * nearPlane / origProjection._11;
float height    = 2.0f * nearPlane / origProjection._22;
float ratio     = width / height;


Original values near 0.1 far 1000 ratio 1.25 Obtained values near 0.1 far 999.93408 ratio 1.25

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631429
• Total Posts
3000034
×