Jump to content
  • Advertisement
Sign in to follow this  
Dalek

Rotations and matrices

This topic is 5460 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

Hi all, I need some clarification on rotation about an axis using matrices. I have one book that describes the rotation around the Z axis as being:
 cos(A)  sin(A)  0   0
-sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
Now this is in a Row major form. I'm using DX so I have Translated it to a column major form as below:
 cos(A) -sin(A)  0   0
 sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
But a website that I have seen says that this should be (in column major form):
 cos(A)  sin(A)  0   0
2sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
This seems to skew the object, not rotate it?? Can anyone enlighten me as to which is correct? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
that is clearly a stupid typo. the latter is dead-wrong. if you draw these columnvectors youll see they wont span an orthogonal space by a longshot. your own deduction is the correct one.

Share this post


Link to post
Share on other sites
Cheers. I thought so (my translated matrix created a rotated object that looked correct), but its nice to get confirmation! :)

Thanks again.

Share this post


Link to post
Share on other sites
An easy way to check or remember the matrices is by what happens to (1,0,0), (0,1,0) and (0,0,1) using trig. Since it is the coordinate axis you don't have to remember the double angle formulas. As an example rotation by t about the z axis takes (1,0,0) to (cos(t),sin(t),0) and (0,1,0) to (-sin(t), cos(t), 0) so those are your first two columns or rows depending upon whether it is Mx or xM.

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.

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!