Advertisement

Moving in 3rd person

Started by March 28, 2003 12:27 PM
17 comments, last by b3rs3rk 21 years, 10 months ago
i got this model and a 3rd person view. i''ve made the model walk on a terrain and i can control it with the mouse (it''s something like Diablo). the model canl walk everywhere on the terrain but the problem is that this fuXXXing bXXch doesn''t turn left or right :°°° i''m trying to use glRotatef(angle,0,1,0) but i need the right angle.. how can i find it?
so?? any advices?
Advertisement
You forgot to say please!
DISCLAIMER: If any of the above statements are incorrect, feel free to deliver me a good hard slap!My games: DracMan | Swift blocks
it''s true.... PLEASE! I BEG YOUR HELP! gghghgh
http://www.gamedev.net/community/forums/topic.asp?topic_id=147514
i''ve tryed something like that but it doesn''t work :|
Advertisement
Use glLookAt() instead. Complete information is found on www.gametutorials.com
i''ll try tnx :D
how i have to use gluLookAt ?!?!?!
The angle you are looking for is the angle between your player''s previous direction vector and the new one. Heres a diagram:


  ________________________________\ \       O  \     ¯T¯    old direction (previous mouse click)   \    / \ ------->    \       \     \       \      \       _| new direction (new mouse click)       \             \__________________________________  


So lets say that you were going right so you clicked right. Your player starts to move in that direction. Then you click down, in order to rotate your player you need to find the angle between the old vector and the new vector and add it to the total of your player''s angle.

Check the net for how to find the angle between two vectors - its an extension of dot product i think.

This topic is closed to new replies.

Advertisement