Original Post
Hi all, I''ve got a problem:
I''m trying to develop a chase camera system (like in Tomb Raider, for example). Everything is fine, but I can''t put the main character into the right place. I''m using the camera code from NeHe''s lesson 10. I''ve got it nicely rotating around a spot a little bit away from the screen, but I can''t place the player on that spot. This is a really dumb problem, but I''m stuck. Please help me.
The code for the camera looks like this:
---
cone3d
http://cone3d.gamedev.net
Multitasking - screwing up several things at once.
// calculate translations and rotations.
xtrans = -xpos-(sin(yrot*piover180) * 0.8f);
ztrans = -zpos-(cos(yrot*piover180) * 0.8f);
ytrans = -0.4;
sceneroty = 360.0f - yrot;
// Rotate and Translate
glRotatef(lookupdown, 1.0f, 0, 0);
glRotatef(sceneroty, 0, 1.0f, 0);
glTranslatef(xtrans, ytrans, ztrans);
// draw the scene
|
---
cone3d
http://cone3d.gamedev.net
Multitasking - screwing up several things at once.