Yes
LittleJackFlash
Posts
-
How to make the camera rotate with the player? -
How to make the camera rotate with the player?Hello sorry I wasn't very clear, basically at the moment I have a camera that following the player in the 4 direction i.e moving forward, backwards and strafing right and left, I was aiming to be able to rotate the camera around the player in order to me able to see the rest of the world around him. yet when I tried adjusting the glrotate i got the camera to kinda rotate but the longer to hold either left or right the further away from the player the camera becomes.
//Bind Camera to Player
gluLookAtf(player.position.getX() + player.xrot ,player.position.getY() + 15, player.position.getZ() + 20,
player.position.getX() ,player.position.getY(),player.position.getZ() ,
0.0, 1.0, 0.0);glPushMatrix();
glRotatef(xrot, 0.0, 0.1, 0.0);
glTranslatef(pos.getX(), pos.getY(), pos.getZ()); -
How to make the camera rotate with the player?I currently have the following code -
gluLookAtf(player.position.getX(),player.position.getY() + 15,player.position.getZ() + 20,
player.position.getX() ,player.position.getY(),player.position.getZ() ,
0.0, 1.0, 0.0);How can I make the player and the camera rotate together?