#### Archived

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

# 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.

## 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 on other sites

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.

Leo.

1. 1
2. 2
Rutin
21
3. 3
4. 4
A4L
15
5. 5
khawk
14

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

• Total Topics
633742
• Total Posts
3013636
×