OpenGL gluLookAt issues

Posted by Chris D on Stack Overflow See other posts from Stack Overflow or by Chris D
Published on 2012-12-09T16:06:42Z Indexed on 2012/12/09 17:04 UTC
Read the original article Hit count: 159

Filed under:
|
|

I am trying to switch my space invaders game to a first person view, i.e. a view of the world from the ship. I am getting a bit confused about what point I should be looking at. I am currently using these parameters in gluLookAt:

GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GLU.gluLookAt(ship3dPos.x, ship3dPos.y, ship3dPos.z,400.0f, 600.0f,-50.0f, 0.0f, 1.0f,-0.0f);

Where ship3dPos is a Vector3f. I'm not sure what I'm supposed to set parameters 4,5 and 6 to, to get a view of the whole world(window is 800/600). I want to have a view of say 100.0 wide from the ships perspective, with this view moving along the x-axis as the player moves the ship. Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about opengl