Petites modifs sur la cam.

This commit is contained in:
Georges Dupéron 2011-10-04 11:34:49 +02:00
parent cf64dc1e17
commit 06aebc12c3
2 changed files with 19 additions and 10 deletions

View File

@ -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) ;

View File

@ -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;