# Calculation rotational values

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

## Recommended Posts

Hi all. How do u calculate rotational values using only a position point and a target point? Like for example, a camera facing a point. Thanks in advance.

##### Share on other sites
Quote:
 Original post by SchinizerHi all.How do u calculate rotational values using only a position point and a target point?Like for example, a camera facing a point.Thanks in advance.
This is discussed pretty often on the forums; here are a few search terms you might try:

billboard
align to vector
align to normal
aim at point
aim at target
rotate to target
look-at transform

Etc.

Note that there's no unique solution to the problem as stated; therefore, you'll need to introduce an additional constraint (a fixed reference or 'up' vector is often used for this purpose). Also, you don't necessarily need to compute rotation values (by which I assume you mean Euler angles or something of that sort); you can just as easily compute the orientation directly in matrix, quaternion, or vector (e.g. orthonormal basis) form.

Note also that a 'look at' function will typically not only orient the object towards a target point, but will also invert the transform (since you mentioned facing a camera towards a point, maybe this is what you're looking for).

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 14
• 9
• 10
• 12
• ### Forum Statistics

• Total Topics
633003
• Total Posts
3009830
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!