Sign in to follow this  

Calculate point in direction

This topic is 2541 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to have the camera look from x,y,z to xtmp,ytmp,ztmp.
For some reason the camera dips down really quick when turning around. I included the code i'm using below.
The Z axis is up.
and the X and Y the player walks on.
This is for 3d mouselook.
Anyone see a problem?

Thanks


float xTmp=player1->x+cos(player1->zRot*3.14/180);
float yTmp=player1->y-sin(player1->zRot*3.14/180)-cos(player1->yRot*3.14/180);
float zTmp=player1->z-sin(player1->yRot*3.14/180)+1;
gluLookAt(player1->x,player1->y,player1->z+1,xTmp,yTmp,zTmp,0,0,1);}


[Edited by - coderWalker on December 30, 2010 9:25:18 AM]

Share this post


Link to post
Share on other sites

This topic is 2541 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this