Jump to content
  • Advertisement

Archived

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

Guest Anonymous Poster

Look at point in 3d

This topic is 6899 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

Okay, you know how to draw 3D so this should be fairly simple.

If you have a character's head and a point to look at, then it fairly simple to find two angles which represent the x and y rotations by trigonometry.
You can find the x rotation by the difference in height between the head and the point and the distance in the y plane between the head and the point, using arcsin

You can find the y rotation by the distance between the head and the point in the x and z vectors using arcsin again.

Then rotate the head in the x then the y.

Sorry, but if I could draw, I'd do diagrams...

If this does not make sense, I suggest try drawing it on paper first....

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster

Hi,

I want to make a character that look to a point (x,y,z). Like Tombraider and Grim Fandango.
And if I move the point, the character move his/her head always looking the point.
Is there some code or ideas about it.

Thanks in advance.

Leo.

Share this post


Link to post
Share on other sites

  • 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!