www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 06aebc12c36ba1be0588e4b2f779601f2273420d
parent cf64dc1e171eecf467743af3031d86331d20cdcf
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Tue,  4 Oct 2011 11:34:49 +0200

Petites modifs sur la cam.

Diffstat:
Mdisplay.c | 13+++++++++++--
Mdisplay.h | 16++++++++--------
2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/display.c b/display.c @@ -61,8 +61,17 @@ int mainLoop() { case SDLK_d: xCamera+=moveDist; break; + case SDLK_DOWN: + ySight -= moveDist; + break; case SDLK_UP: - xAngle += 16; + ySight += moveDist; + break; + case SDLK_LEFT: + xSight -= moveDist; + break; + case SDLK_RIGHT: + xSight += moveDist; break; default: @@ -107,7 +116,7 @@ void renderScene() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //gluLookAt(1024,512,1356,1024,512,0,0,1,0); - gluLookAt(xCamera,yCamera,zCamera,xSight,ySight,zSight,0,1,0); + gluLookAt(xCamera,yCamera,zCamera,xCamera+xSight,yCamera+ySight,zCamera+zSight,0,1,0); //glClearColor(1,1,1,1); // pour un fond blanc glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; diff --git a/display.h b/display.h @@ -17,12 +17,12 @@ int *vertices; int windowWidth = 1024; int nbVertex = 0; int windowHeight = 768; -int xCamera = 1024; -int yCamera = 400; -int zCamera = 1500; -int xSight = 1024; -int ySight = 512; -int zSight = 0; -int yAngle = 0; -int xAngle = 0; +float xCamera = 1024; +float yCamera = 400; +float zCamera = 1500; +int xSight = 0; +int ySight = 112; +int zSight = -1500; +float xAngle = 0; +float yAngle = 0; int moveDist = 64;