commit 3cd9ee32156ad44ab81292f0ecc43ccb6cd4184c
parent 020bcc9f69135538291828e6b60021da0a44d541
Author: Yoann <yoann.b87@voila.fr>
Date: Mon, 10 Oct 2011 08:51:29 +0200
Ajout du fichier d'entête de square et suppression de l'affichage de
roam.
Diffstat:
3 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/display.c b/display.c
@@ -123,13 +123,13 @@ void renderScene() {
drawAxes();
//displayTree2();
- displayTree(t);
+ //displayTree(t);
glFlush();
SDL_GL_SwapBuffers();
}
-
+/*
int nbTriangles(Triangle *t) {
int sum = 0;
@@ -142,9 +142,9 @@ int nbTriangles(Triangle *t) {
}
return sum;
-}
-
+}*/
+/*
void insertValues(Triangle *t,int *vertices) {
if(t->tLeftChild == NULL) {
vertices[9*nbVertex] = t->vLeft->x;
@@ -162,15 +162,15 @@ void insertValues(Triangle *t,int *vertices) {
insertValues(t->tLeftChild,vertices);
insertValues(t->tRightChild,vertices);
}
-}
-
+}*/
+/*
void displayTree2() {
glVertexAttribPointer(0, 3, GL_INT, GL_FALSE, 0, vertices);
glEnableVertexAttribArray(0);
glColor3ub(255,255,255);
glDrawArrays(GL_LINE_LOOP,0, nbVertex*3);
-}
+}*/
int max3(int x,int y,int z) {
if(x < y && x < z) return x;
@@ -178,7 +178,7 @@ int max3(int x,int y,int z) {
if(z < x && z < y) return z;
return 0;
}
-
+/*
void setNormals(Triangle *t) {
if(t->tLeftChild == NULL) {
int ax = t->vLeft->x - t->vApex->x;
@@ -231,17 +231,17 @@ void displayTree(Triangle *t) {
displayTree(t->tLeftChild);
displayTree(t->tRightChild);
}
-}
+}*/
int main() {
initWindow();
- t = initDefaultExample();
- nbVertex = nbTriangles(t);
- printf("nombre de triangles : %d\n",nbVertex);
+ //t = initDefaultExample();
+ //nbVertex = nbTriangles(t);
+ //printf("nombre de triangles : %d\n",nbVertex);
// Calcul des normales des traingles.
- setNormals(t);
+ //setNormals(t);
// Réorganisation des sommets pour l'affichage optimisé.
//vertices = (int*) malloc(sizeof(int) * nbTriangles(t)*9+1);
diff --git a/display.h b/display.h
@@ -1,18 +1,18 @@
#include <SDL/SDL.h>
#include <GL/glew.h>
#include <GL/glu.h>
-#include "roam.h"
+#include "square.h"
#include <math.h>
int initWindow();
int mainLoop();
void renderScene();
-void setNormals(Triangle *t);
-void displayTree(Triangle *t);
-void displayTree2();
+//void setNormals(Triangle *t);
+//void displayTree(Triangle *t);
+//void displayTree2();
void Draw_Axes ();
-Triangle *t;
+//Triangle *t;
int *vertices;
int windowWidth = 1024;
int nbVertex = 0;
diff --git a/square.c b/square.c
@@ -1,5 +1,4 @@
-// get_z()
-#include "roam.h"
+#include "square.h"
// Positionne v à (xx,yy) et calcule z. Met ref_count à 0.
#define INIT_VERTEX(v,xx,yy) do { (v)->refCount=0; (v)->x=(xx); (v)->y=(yy); (v)->z=get_z((xx),(yy)); } while(0);