1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| #include <stdio.h>
#include <GL/freeglut.h>
#include "humains.c"
void display();
int main(int argc, char** argv) {
int choix = 1;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(950, 950);
glutInitWindowPosition(100, 20);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glEnable(GL_DEPTH_TEST); /* Calcule la profondeur des faces cachees */
glutKeyboardFunc(keyboard);
glutMainLoop();
}
}
void display() {
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
gluLookAt(0.0, 0.0, anglecamp, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glRotatef(anglecamx, 1, 0, 0);
glRotatef(anglecamy, 0, 1, 0);
glRotatef(anglecamz, 0, 0, 1);
affiche_grille();
} |
Partager