Jump to content
  • Advertisement


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

Guest Anonymous Poster

Look at point in 3d

This topic is 6985 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
Guest Anonymous Poster


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.


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!