FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[OT] coordinates rotation

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Thu Jul 08, 2004 1:28 pm    Post subject: [OT] coordinates rotation Reply with quote

I know some of you have done (or do) 3D programming, so I'd like to know how to perform a rotation but using a different axis than X, Y or Z. (I really don't know how to phrase it).
In other words: to do a Z-rotation, this matrix is used: [ [ cos, sin, 0 ] [ -sin, cos, 0 ] [ 0, 0, 1 ] ]. The way I see it, it uses vector (0,0,1) as rotation axis, right? Is that how it's said? Anyway, what I want is to be able to caculate the matrix to do a rotation using any given vector (x,y,z).
Thanks a lot!
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
nail



Joined: 30 Jun 2004
Posts: 18
Location: Krasnoznamensk, Moscow region, Russia

PostPosted: Fri Jul 09, 2004 4:53 am    Post subject: Reply with quote

Hm... I think you choosed wrong place for this question. I'll try to introduce you in this topic. There are several ways to rotete your object.

First - Euler angles. When you have sequense of rotation around X then Y then Z. Or around Z then around Y, then X. Or any another sequence. In this case you should create X-rotation matrix, Y-rotation matrix, Z-rotation matrix and then multiply them in chosen order. You'll get final matrix for your rotation. Euler angles sometimes called yaw-pitch-roll - they are airplane therms.

Second - Axis / angle. When you set axis as vector and angle of rotation around it. Check out http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/ page

Third - most powerful method (and so most complicated for novice) is quaternions. Quaternion is 4D mathematical object that human can't imagine. Learn more about quaternions on http://www.gamedev.net/reference/articles/article1095.asp
Back to top
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Fri Jul 09, 2004 11:27 am    Post subject: Reply with quote

nail wrote:
Hm... I think you choosed wrong place for this question. I'll try to introduce you in this topic. There are several ways to rotete your object.

First - Euler angles. When you have sequense of rotation around X then Y then Z. Or around Z then around Y, then X. Or any another sequence. In this case you should create X-rotation matrix, Y-rotation matrix, Z-rotation matrix and then multiply them in chosen order. You'll get final matrix for your rotation. Euler angles sometimes called yaw-pitch-roll - they are airplane therms.

That's what I had. I needed a more general solution.

nail wrote:
Second - Axis / angle. When you set axis as vector and angle of rotation around it. Check out http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/ page

Thanks!!!! That's exactly what I was looking for!

nail wrote:
Third - most powerful method (and so most complicated for novice) is quaternions. Quaternion is 4D mathematical object that human can't imagine. Learn more about quaternions on http://www.gamedev.net/reference/articles/article1095.asp

I can pass on that for now.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group