Public Group

# About rotation axis and orthogonality

This topic is 2588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So I just want to talk about broad API calls and euler rotations and matrices for a second.

Are euler rotations always going to be in relation to an object's axis? For example, in XNA there is:

Matrix.CreateFromYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z)
[font="Lucida Sans Unicode"]1. So here I assume that you rotate on the object's Y-axis which coincides with the world's y-axis. After, you then would rotate on the x-axis (wherever that may be after the y rotation) of the object and not the world. Is this generally the case for euler rotations and these types of functions? I only ask to bring the distinction between functions like[/font]

Matrix.CreateFromAxisAngle(angle, vector)

[font="Lucida Sans Unicode"] [font="Lucida Sans Unicode"]2. I only worry about orthogonality if I am creating a matrix from scratch right? In other words, the function above and quaternion functions in frameworks always drag axis along for the ride together. It's never like you can rotate one axis without effecting the others. Thus, maintaining orthogonality. [/font][/font]

3. For gimbal lock, I see online videos of the problem through a parent structure where if I am rotating (x,y,z), an x rotation will move the y and z axis. A y rotation will only affect the z axis and so on. However, I thought that each axis is moved along for the ride as mentioned above so they would always be orthogonal to one another. Can anyone clarify?

##### Share on other sites
Matrix.CreateFromYawPitchRoll(y, x, z) isn't related to anything, it just creates rotation effect. It'll be in relation to an object's axis or global axis depending what you do with the matrix later.
Matrix.CreateFromAxisAngle(angle, vector) simply creates matrix which rotates around any vector, not only standard like in YawPitchRoll case.
Matrix.CreateFromYawPitchRoll(y, x, z) == Matrix.CreateFromAxisAngle(y, new Vector3(0, 1, 0)) * Matrix.CreateFromAxisAngle(x, new Vector3(1, 0, 0)) * Matrix.CreateFromAxisAngle(z, new Vector3(0, 0, 1));

I don't know much to comment on other questions.

##### Share on other sites

Matrix.CreateFromYawPitchRoll(y, x, z) isn't related to anything, it just creates rotation effect. It'll be in relation to an object's axis or global axis depending what you do with the matrix later.
Matrix.CreateFromAxisAngle(angle, vector) simply creates matrix which rotates around any vector, not only standard like in YawPitchRoll case.
Matrix.CreateFromYawPitchRoll(y, x, z) == Matrix.CreateFromAxisAngle(y, new Vector3(0, 1, 0)) * Matrix.CreateFromAxisAngle(x, new Vector3(1, 0, 0)) * Matrix.CreateFromAxisAngle(z, new Vector3(0, 0, 1));

I don't know much to comment on other questions.

For Matrix.CreateFromYawPitchRoll, I meant during the operation. If you pitch first let's say 90 degrees, than the local y-axis will now line up with the world z-axis. If you want to now yaw, will you yaw around the world's y-axis at (0,1,0) or the local's (0,0,1)?

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634096
• Total Posts
3015493
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!