Jump to content
  • Advertisement
Sign in to follow this  
Schinizer

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Schinizer
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.
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

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!