问题
I have a 4x4 projection matrix
(SCNMatrix4)
s = (m11 = 1.83226573,
m12 = 0,
m13 = 0,
m14 = 0,
m21 = 0,
m22 = 2.44078445,
m23 = 0,
m24 = 0,
m31 = -0.00576340035,
m32 = -0.0016724075,
m33 = -1.00019991,
m34 = -1,
m41 = 0,
m42 = 0,
m43 = -0.20002,
m44 = 0)
I would like to get the focal point and the focal length out of this matrix.
回答1:
From slides 4 and 5 on this GDC presentation:
The focal length is merely the first element in the matrix (m11
).
The focal point, however, cannot be extracted from this matrix alone - you need the camera direction D
and position P
. Once you have them, simply do P + D * m11
to obtain the focal point.
来源:https://stackoverflow.com/questions/46075606/getting-focal-length-and-focal-point-from-a-projection-matrix