Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMMatrixRotationRollPitchYaw arguments order #53

Closed
nlguillemot opened this issue May 21, 2017 · 1 comment
Closed

XMMatrixRotationRollPitchYaw arguments order #53

nlguillemot opened this issue May 21, 2017 · 1 comment

Comments

@nlguillemot
Copy link

The function is named XMMatrixRotationRollPitchYaw, but its arguments are in a different order, which is a little tricky:

inline XMMATRIX XM_CALLCONV XMMatrixRotationRollPitchYaw
(
    float Pitch, 
    float Yaw, 
    float Roll
)

Don't know if there's an easy backwards-compatible fix to this problem, but I figure it should be documented as an issue anyways.

@walbourn
Copy link
Member

walbourn commented May 22, 2017

The function name indicates the order of rotation which is roll, then pitch, then yaw. The parameter order itself is x-axis, y-axis, z-axis which makes a bit more sense with XMMatrixRotationRollPitchYawFromVector.

This is also true of the XMQuaternionRotationRollPitchYaw function, as well as XMQuaternionRotationRollPitchYawFromVector.

The original D3DXMath function D3DXMatrixRotationYawPitchRoll used parameter order of 'yaw', 'pitch', 'roll' but the actual order of the rotations was roll, then pitch, then yaw based on the convention of matrix notation. So, I'd argue the DirectXMath naming convention is probably a bit more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants