Camera Follow
I am trying to implement 3rd person view into my engine- but i am only in 8th grade and don''t know the right math. Can someone give me a formula or something (trig?) to position a camera behind a model?
It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits and not to seek exactness when only an approximation of the truth is possible.
ermokwww.truevision3d.com
read about spherical coordinates... too tired to write more right now...
You know what I never noticed before?
You don''t need complex math. Just some basic trig that you can learn in an internet tutorial or library book.
glulookat(-cos(player.angle)*distance, 0.5, -sin(player.angle)*distance, player.x, player.y, player.z, 0, 1, 0);
glulookat(-cos(player.angle)*distance, 0.5, -sin(player.angle)*distance, player.x, player.y, player.z, 0, 1, 0);
Not much differnt but slightly better
glulookat(-cos(player.angle)*distance + player.x, rideheight + player.y, -sin(player.angle)*distance + player.z, player.x, player.y, player.z, 0, 1, 0)
glulookat(-cos(player.angle)*distance + player.x, rideheight + player.y, -sin(player.angle)*distance + player.z, player.x, player.y, player.z, 0, 1, 0)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement