GLULOOKAT

Is there a way to handle a camera(glulookat(),so that always keep my character in view

Like a third-person-camera (i.e Gears of War)? It’s around 25 lines, with rotation .

Start with something simpler, 2 lines of code:


vec3 cameraPos = playerPos + vec3(0,3,5);
gluLookAt(cameraPos.x,cameraPos.y,cameraPos.z,  playerPos.x,playerPos.y,playerPos.z,   0,1,0);