#### Archived

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

# 3d Character Rotation

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

## Recommended Posts

Howzit I''m using OpenGL. I''ve got this scenario. I''ve got a 3D model of a man, he has a facing angle. I''ve also got a point of origin and if I click then I have a point to which he must go. I''m making it so the whole screen moves, not just the character. What I want to know is how to rotate the character so he is facing in the direction where I clicked the mouse. I can use glRotatef but I first have to get the angle to move. He must also rotate to the point, not just flip. Shot

##### Share on other sites
Well, that involves a number of things. First, I am guessing that though the frame is 3d, the man moves in a 2Dimentional manner- aka he walks around the x-y plane. How are you creating your 2D point from the click in 3D space?

Anyhow, once you get your point, you can use an assortment of methods to finding out the angle between two vectors ( http://www.gamedev.net/community/forums/topic.asp?topic_id=102671 ), such as dot product, cross product, or good ol'' atan.

since im @ school w/ nothing better to do, here''s a pic =P

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633700
• Total Posts
3013426
×