Affichage correct des triangles mais pas encore avec les effets de

lumière.
This commit is contained in:
Yoann 2011-10-11 09:13:45 +02:00
parent f67a80364a
commit 734ff444b5
2 changed files with 7 additions and 4 deletions

View File

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

View File

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