# Quaternions again!

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

## Recommended Posts

Hello there, I have a Quaternion which rotates (left/right look) sucessfully so I figured that much out... I was wondering if I have a pitch as a separate value in radians (up/down look), then how can I combine this data with the Quaternion so that I can "face" a point in space at x,y,z. Thanks for any suggestions, i'm slowly trying to understand this...

##### Share on other sites
If you have a point p1 you are currently looking at target point p2 you want to look at after some rotation, you can build the rotation quaternion like this:

Let c be the current location (or the rotation center):

axis = cross( p2 - c, p1 - c );
angle = arccos( dot( p2 - c, p1 - c ) )

quat = rotation( normalize( axis ), angle )

So much in theory. In praxis you do it little different to avoid numerical issues. Here is some good references (scroll down to the bottom of the page):

http://www.essentialmath.com/tutorial.htm

1. 1
2. 2
Rutin
19
3. 3
khawk
15
4. 4
A4L
13
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633744
• Total Posts
3013658
×