Public Group

#### Archived

This topic is now archived and is closed to further replies.

# rotation matrix

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

## Recommended Posts

hi, let''s say I have 2 UNIT vectors v1=[a,b,c] and v2=[d,e,f] . Is there a simple way of calculating the rotation matrix for a rotation from v1 to v2? Thanks in advance

##### Share on other sites
Check out quaternions. They are fast and easy

----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. They who understand binary and those who do not"

##### Share on other sites
quote:
Original post by bgbg
hi, let''s say I have 2 UNIT vectors v1=[a,b,c] and v2=[d,e,f] .
Is there a simple way of calculating the rotation matrix for a rotation from v1 to v2?

There are an infinite number of such rotations, since a vector is insufficient to express roll. Consider the case of a rolling aircraft; both the "before" and "after" vectors are the same.

If you don''t have to worry about roll, and can define a third "up" vector (or, if you prefer, another cardinal-direction vector), you can use a Gramm-Schmidt orthonormalization (google is your friend) and use the resultant bases as rows of your matrix. gluLookAt does this.

How appropriate. You fight like a cow.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633685
• Total Posts
3013322
×