Une petite démo :) . Lancer make test.
This commit is contained in:
parent
fb7caa7290
commit
3e1ad07f6e
|
@ -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();
|
||||
|
|
5
roam.c
5
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); */
|
||||
|
|
Loading…
Reference in New Issue
Block a user