Ajout de la méthode de dessin des QuadTree dans display.

Pas encore d'affichage à l'écran.
This commit is contained in:
Yoann 2011-10-10 09:38:28 +02:00
parent f0cf6bed6d
commit f2a444df2d
3 changed files with 12 additions and 8 deletions

View File

@ -122,13 +122,16 @@ void renderScene() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ;
drawAxes();
//displayTree2();
//displayTree(t);
displayQTTree(qtn);
glFlush();
SDL_GL_SwapBuffers();
}
void displayQTTree(QTNode *qn) {
QT_enumerate(qn);
}
/*
int nbTriangles(Triangle *t) {
int sum = 0;
@ -198,9 +201,6 @@ void setNormals(Triangle *t) {
y = y/length;
z = z/length;
t->vLeft->xNormal = x;
t->vLeft->yNormal = y;
t->vLeft->zNormal = z;
@ -236,7 +236,7 @@ void displayTree(Triangle *t) {
int main() {
initWindow();
//t = initDefaultExample();
qtn = QT_example();
//nbVertex = nbTriangles(t);
//printf("nombre de triangles : %d\n",nbVertex);

View File

@ -7,12 +7,13 @@
int initWindow();
int mainLoop();
void renderScene();
void displayQTTree(QTNode *qn);
//void setNormals(Triangle *t);
//void displayTree(Triangle *t);
//void displayTree2();
void Draw_Axes ();
//Triangle *t;
QTNode *qtn;
int *vertices;
int windowWidth = 1024;
int nbVertex = 0;

View File

@ -203,6 +203,8 @@ void QT_enumerate(QTNode* first) {
QTNode* n;
int r;
Vertex* v;
v=NULL;v=v;
r=0;r=r;
for (n = first; n != NULL; n = n->nextNode) {
// GL_Begin(TRIANGLE_FAN_LOOP);
// envoyer le vertex central :
@ -211,8 +213,9 @@ void QT_enumerate(QTNode* first) {
for (r = 0; r < 4; r++) {
// On parcourt tous les vertices le long du côté.
for (v = n->vertices[ROT_NO]; v != n->vertices[ROT_NE]; v = v->next[ROT_E]) {
printf("%d\n",r);
// envoyer un vertex du fan :
(void)(v);
//(void)(v);
}
}
// Nécessaire ssi on fait un TRIANGLE_FAN et qu'on ne peut pas lui dire de fermer la boucle.