#### Archived

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

# Rotation

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

## Recommended Posts

Hey, I know two pieces of information. The vertices of my triangles and their normals. How, then, using this data, can I find the rotation values necessary to rotate vector A (0, 0, 1) so that it points in the same direction as vector B (the normal)? Thanks in advance, Ben

##### Share on other sites
If A and B are unit vectors then the dot product of A and B is the cosine of the angle between them. It is actually the magnitude of A times the magnitude of B times the cosines of the angle between them, but the magnitudes are one for unit vectors.

##### Share on other sites
I know the dot product is the angle between them. But that doesn''t tell me what the rotations were that made the normal face that way. (ie, is the rotation on the x axis? y axis? a combination of x and z?)

Ben

##### Share on other sites
quote:
Original post by pr0teus

I know the dot product is the angle between them. But that doesn''t tell me what the rotations were that made the normal face that way. (ie, is the rotation on the x axis? y axis? a combination of x and z?)

Ben

Well, if you take the arccos of the dot product, that''s the angle. And the cross product of the two vectors is the axis of rotation. Now you have an axis of rotation and an angle, which you can convert to angles.

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 12
• 16
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633357
• Total Posts
3011500
• ### Who's Online (See full list)

There are no registered users currently online

×