matrix rotation order
I''ve tried looking through the math and physics forum for this question but i couldn''t find one explaining it so i apologize if this is a double-post that has already been answered before...
I was wondering, since most engines'' interfaces that I look at provide a Rotate function that takes 3 parameters: rotation about the x,y,z axis respectively. But since applying more than one rotation at a time would mean the engine would have to concatenate the individual rotation matrices, is there a ''correct'' order to concatenate the matrices? For example, ogl uses glrotatef and takes 4 parameters(but it still lets you apply rotation about all 3 axis in one call) does the order of concatenating the 3 individual rotation matrices into one combined rotation matrix matter? I was wondering about this since if the point is not at the origin, then rotation say 90 degrees about the x-axis then 90 around the y-axis creates a differnt position for the point than 90 degrees around y-axis first then 90 degrees around x-axis. Or is it just programmer preference and the concatenation order should be documented for the end-user.
Well, you have kind of answered your own question - the order of rotation does matter.
The correct order of rotation is to do yaw, then pitch, then roll. (Y-X-Z).
The correct order of rotation is to do yaw, then pitch, then roll. (Y-X-Z).
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
There is no "true" correct order to apply euler rotations, which is just one of several reasons euler angles suck.
Jeff
Jeff
super genius
1. Order is important.
2. There is no "correct" order. There are preferred orders and there are standard orders.
3. glRotate does 1 rotation around 1 axis, not 3 rotations around 3 axes.
2. There is no "correct" order. There are preferred orders and there are standard orders.
3. glRotate does 1 rotation around 1 axis, not 3 rotations around 3 axes.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
All fix angle representations run into Gimble Lock. So that''s why quaternions are introduced.
Quaternions were introduced because it is often convenient to work in a "polar" form for rotations. You can effectively use a vector describing the axis of rotation and an angle. Depending on the situation, either form can be more useful - much like Euler and cylindrical (or spherical) coordinates.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement