Jump to content
  • Advertisement
Sign in to follow this  
Sansros

About rotation axis and orthogonality

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!