d3d9.dllRotateAxis
Microsoft DirectX 9.0 SDK Update (October 2004)

ID3DXMatrixStack::RotateAxis Method


Rotates (relative to world coordinate space) around an arbitrary axis.

Syntax

HRESULT RotateAxis(      

    CONST D3DXVECTOR3 *pV,     FLOAT Angle );

Parameters

pV
[in] Pointer to the arbitrary axis of rotation. See D3DXVECTOR3.
Angle
[in] Rotation angle about the arbitrary axis, in radians. Angles are measured counterclockwise when looking along the arbitrary axis toward the origin.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be D3DERR_INVALIDCALL.



Remarks

This method adds the rotation to the matrix stack with the computed rotation matrix similar to the following:
D3DXMATRIX tmp;
D3DXMatrixRotationAxis( &tmp, pV, angle );
m_stack[m_currentPos] = m_stack[m_currentPos] * tmp;

Because the rotation is right-multiplied to the matrix stack, the rotation is relative to world coordinate space.

See Also

D3DXMatrixRotationAxis, ID3DXMatrixStack::RotateAxisLocal, ID3DXMatrixStack::RotateYawPitchRoll, ID3DXMatrixStack::RotateYawPitchRollLocal


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.