www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3e1ad07f6e5ce8423127f26052fef82b990daaa9
parent fb7caa7290a58ee69142f319b27926567c434022
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Sat,  1 Oct 2011 18:59:34 +0200

Une petite démo :) . Lancer make test.

Diffstat:
Mdisplay.c | 3++-
Mroam.c | 5+----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/display.c b/display.c @@ -67,7 +67,8 @@ void drawAxes() { void renderScene() { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - gluLookAt(1024,512,1356,1024,512,0,0,1,0); + //gluLookAt(1024,512,1356,1024,512,0,0,1,0); + gluLookAt(1024,-200,500,1024,512,0,0,1,0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; drawAxes(); diff --git a/roam.c b/roam.c @@ -129,8 +129,6 @@ int get_z(int x, int y) { int x2 = x1 + step; int y2 = y1 + step; z += interpolation(x, y, x1, y1, x2, y2, hash(seed, x2, y1) & zmax, hash(seed, x2, y2) & zmax, hash(seed, x1, y2) & zmax, hash(seed, x1, y1) & zmax); - //fprintf(stderr, "x=%d y=%d x1=%d y1=%d x2=%d y2=%d hash(seed, x2, y1)=%d ans&zmax=%d\n", x, y, x1, y1, x2, y2, hash(seed, x2, y1), hash(seed, x2, y1) & zmax); - //break; } // ici le résultat est entre 0 (inclues) et 2^(1+maxlevel) (non inclus) // On normalise sur [0,256[ sachant que 256 == 2^8 @@ -142,7 +140,6 @@ int get_z(int x, int y) { } void triangle_split(Triangle* t) { - printf("split (%d,%d) (%d,%d) (%d,%d)\n", t->vLeft->x, t->vLeft->y, t->vRight->x, t->vRight->y, t->vApex->x, t->vApex->y); Triangle* b; /* base neighbor */ Vertex* c; /* center vertex */ Triangle* subTLeft; @@ -365,7 +362,7 @@ Triangle* initDefaultExample() { t->tRightNeighbor = NULL; t->tParent = NULL; - recursiveSplit(t, 10); + recursiveSplit(t, 13); /* triangle_split(t); */ /* triangle_split(t->tLeftChild); */ /* triangle_split(t->tLeftChild->tLeftChild); */