Skip to main content
GameDev.net gamedev.net
🔒 Locked

FPS

Started by manutd Aug 26, 2000 at 5:24 AM 2 replies 350+ views
Original Post
manutd
manutd
Hey, I would like to do a FPS for learning basis. Is it possible to use glulookat for this, or is it better to rotate and translate or use matrices ?? Thanks for any replys in advance -Jamie
manutd
manutd
When I use glulookat the scene doesn''t work properly like when I use gltranslatef and glrotatef


here is my current line of code:

    

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer


glPushMatrix();
GLfloat xtran = -xpos;
GLfloat ztran = -zpos;
GLfloat yrot = 360.0f - ang;
gluLookAt(xpos,-1,zpos,xpos,0,zpos,0,1,0);
//glTranslatef(xpos,0,ztran); //I only use ztran and not ztran and xtran

//because it doesn''t work if i do

glRotatef(ang,0,1,0);
glBindTexture(GL_TEXTURE_2D, texture[0]);
// Then the cube






-Jamie
zedzeek
zedzeek
gluLookAt(xpos,-1,zpos,xpos,0,zpos,0,1,0);
the first 3 are the position of the camera
the second three are where the cameras looking to
here you''re just looking straight up in the air
i expect u wanna do someit like
gluLookAt(xpos,-1,zpos,xpos+xdirection,-1+ydirection,zpos+zdirection,0,1,0);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.