PDA

View Full Version : Camera JUMP



Erakis
10-19-2002, 06:38 PM
Hello http://www.opengl.org/discussion_boards/ubb/smile.gif

I implemented a camera (Quake style - First Person shooter). Now, to finish my work, my last question is : How can I add a function that could give to the player the possibility to JUMP (Step).

Each frames, the camera is updated...


Ex :



function DrawScene(void)
{
glClear(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();

TheCamera.Update();
}


So do I need a timer to follow the jump event or something else ?

Thanks
Martin

GameMaker
10-20-2002, 11:34 AM
Usually the camera would simulate being attached to the player's head and the physics of the player jumping and gravity pulling the player back down would make the camera do what you want.

If you just want a quick method, add the sine of an angle incrementing from 0 to 180 degrees.