UnsafeNativeMethods.Matrix.LookAtRH Method |
Language: |
Builds a right-handed look-at matrix.
Visual Basic Public Shared Function LookAtRH( _
ByVal pOut As Matrix, _
ByVal cameraPosition As Vector3, _
ByVal cameraTarget As Vector3, _
ByVal cameraUpVector As Vector3 _
) As MatrixC# public static Matrix LookAtRH(
Matrix pOut,
Vector3 cameraPosition,
Vector3 cameraTarget,
Vector3 cameraUpVector
);C++ public:
static Matrix LookAtRH(
Matrix pOut,
Vector3 cameraPosition,
Vector3 cameraTarget,
Vector3 cameraUpVector
);JScript public static function LookAtRH(
pOut : Matrix,
cameraPosition : Vector3,
cameraTarget : Vector3,
cameraUpVector : Vector3
) : Matrix;
pOut Microsoft.DirectX.Matrix
A Matrix structure that is a right-handed look-at matrix.cameraPosition Microsoft.DirectX.Vector3
A Vector3 structure that defines the camera point. This value is used in translation.cameraTarget Microsoft.DirectX.Vector3
A Vector3 structure that defines the camera look-at target.cameraUpVector Microsoft.DirectX.Vector3
A Vector3 structure that defines the up direction of the current world, usually [0, 1, 0].
Microsoft.DirectX.Matrix
A Matrix structure that is a right-handed look-at matrix.
This method uses the following formula to compute the returned matrix.
zaxis = normal(cameraPosition - cameraTarget) xaxis = normal(cross(cameraUpVector, zaxis)) yaxis = cross(zaxis, xaxis) xaxis.x yaxis.x zaxis.x 0 xaxis.y yaxis.y zaxis.y 0 xaxis.z yaxis.z zaxis.z 0 -dot(xaxis, cameraPosition) -dot(yaxis, cameraPosition) -dot(zaxis, cameraPosition) 1The return value for this method is the same value returned in the pOut parameter. This allows you to use the LookAtRH method as a parameter for another method.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center