In Unity M33 is:
(far + near) * rcpdz
while System M33 is:
result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
In Unity M34 is:
2.0f * near * far * rcpdz
while System M43 is:
result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
Note that both matrices are transposed to each other; System Matrix can be thought of as rotating the coordinate system itself while Unity Matrix rotates the given vector.
The Unity.Mathematics implementation of
PerspectiveOffCenter()
Linkdiffers from the .NET
System.Numerics.Matrix4x4
implementation:In Unity
M33
is:(far + near) * rcpdz
while SystemM33
is:result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
In Unity
M34
is:2.0f * near * far * rcpdz
while SystemM43
is:result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
Note that both matrices are transposed to each other; System Matrix can be thought of as rotating the coordinate system itself while Unity Matrix rotates the given vector.