Archived

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

Pointed

OpenGL OpenGL Tomb Raider Style Rotation

Recommended Posts

Hi, Im making a first person Soccer game using OGL.. The game is at a stage where I can run around the field, however presently it is in QUAKE (tunnel vision) mode. I would like to have the player visible just in front of the screen, just like in Tomb Raider. Hence I need to have the world rotate around a ''y'' axis which needs to be just in from of the camera. How can I move the y-axis forward?? or should I just move the camera view back along the z axis?? Thanks for your time, Pointed

Share this post


Link to post
Share on other sites
In my flight sim I use a -Z value (and a small +Y up value) to place the pov behind the airplane. The resultant coordinates are then translated and rotated. This retains the coordinates of the main object, airplane or player, to interact with other objects.

Good luck with the soccer game - it sounds ambitious!

Share this post


Link to post
Share on other sites
glTranslatef(0.0f,distance_from_player,0.0f); //to translate infront of the player
glRotate3f(angle_measure,0.0f,1.0f,0.0f);//to rotate around the y axis.
Is that what you were looking for?

JoeMont001@aol.com

Share this post


Link to post
Share on other sites
Hi Pointed,

I would say you''re better trying looking for a doc on Rotation using quadradic". This is the type of rotation used in Tomb Raider or in any good "Third person view"


lowrad

Share this post


Link to post
Share on other sites
I think what lowrad is actually trying to say is to use "quaternions" for your rotations. You will not be able to get smooth interpolations of your camera rotations without them.
(unless you fix the x-axis rotation to a static angle).

Share this post


Link to post
Share on other sites