Hi! These are:

```
switch (key) {
case 87: //W
case 119: //w
glLoadIdentity();
eyeX += cos(angleX) * K;
eyeY += sin(angleY) * K;
eyeZ += -sin(angleX) * K;
centerX += cos(angleX) * K;
centerY += sin(angleY) * K;
centerZ += -sin(angleX) * K;
gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, 0, 1, 0);
display4();
return;
case 83: //S
case 115: //s
glLoadIdentity();
eyeX -= cos(angleX) * K;
eyeY -= sin(angleY) * K;
eyeZ -= -sin(angleX) * K;
centerX -= cos(angleX) * K;
centerY -= sin(angleY) * K;
centerZ -= -sin(angleX) * K;
gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, 0, 1, 0);
display4();
return;
case 65: //A
case 97: //a
glLoadIdentity();
eyeX += cos(angleX + pi/2) * K;
eyeZ += -sin(angleX + pi/2) * K;
centerX += cos(angleX + pi/2) * K;
centerZ += -sin(angleX + pi/2) * K;
gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, 0, 1, 0);
display4();
return;
case 68: //D
case 100: //d
glLoadIdentity();
eyeX += cos(angleX - pi/2) * K;
eyeZ += -sin(angleX - pi/2) * K;
centerX += cos(angleX - pi/2) * K;
centerZ += -sin(angleX - pi/2) * K;
gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, 0, 1, 0);
display4();
return;
}
```

and voilà!!! You have a Quake style FPS!!!

Although a good way to do that is when you press a key, you set a boolean to true, and when you release set to false. This increases real-time rendering. Although, I learn yesterday that you should NOT call display func directly, but call glutPostRedisplay();

Ahhhh! And remember doing the angle tests!! I didn’t performed it in these operations. It means, in other words:

if (angleY > 90.0f) {

angleY = 90.0f;

}

if (angleY < -90.0f) {

angleY = -90.0f;

}

That restricts the player to look up and stop.

That’s it! Hope it would be useful to the Opengl community, to me it was… Bye!!