From 734ff444b5d84c084d1a33d7793fd0990bf3361e Mon Sep 17 00:00:00 2001 From: Yoann Date: Tue, 11 Oct 2011 09:13:45 +0200 Subject: [PATCH] =?UTF-8?q?Affichage=20correct=20des=20triangles=20mais=20?= =?UTF-8?q?pas=20encore=20avec=20les=20effets=20de=20lumi=C3=A8re.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- display.h | 4 ++-- square.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/display.h b/display.h index d550708..50037cc 100644 --- a/display.h +++ b/display.h @@ -21,11 +21,11 @@ int nbVertex = 0; float xCamera = 100; float yCamera = 500; -float zCamera = 1500; +float zCamera = 3000; int xSight = 100; int ySight = -500; -int zSight = -1500; +int zSight = -3000; float xAngle = 0; float yAngle = 0; diff --git a/square.c b/square.c index 178ca0b..8915122 100644 --- a/square.c +++ b/square.c @@ -222,6 +222,7 @@ void QT_enumerate(QTNode* first) { for (n = first; n != NULL; n = n->nextNode) { qtnode_print(n); glBegin(GL_TRIANGLE_FAN); + glNormal3f(0,1,0); // envoyer le vertex central (void)(n->center); @@ -237,15 +238,17 @@ void QT_enumerate(QTNode* first) { //(void)(v); } } - glEnd(); + // Nécessaire ssi on fait un TRIANGLE_FAN et qu'on ne peut pas lui dire de fermer la boucle. // On renvoie le 1er vertex du bord : (void)(n->vertices[QT_NO]); + glVertex3f(n->vertices[QT_NO]->x,n->vertices[QT_NO]->y,n->vertices[QT_NO]->z); + glEnd(); } } QTNode* QT_example() { QTNode* q = QT_baseNode(); - //QT_split(q); + QT_split(q); return q; }