-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
75 lines (60 loc) · 1.36 KB
/
main.c
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <stdio.h>
#include <stdlib.h>
#include "GL/gl.h"
#include "GL/glut.h"
#include "snake.h"
int main(int argc, char *argv[]) {
/* Plans */
plan1.p1.x = 80;
plan1.p1.y = 0;
plan1.p1.z = -80;
plan1.p2.x = -80;
plan1.p2.y = 0;
plan1.p2.z = -80;
plan1.p3.x = -80;
plan1.p3.y = 0;
plan1.p3.z = 80;
plan1.p4.x = 80;
plan1.p4.y = 0;
plan1.p4.z = 80;
plan2.p1.x = -80;
plan2.p1.y = 0;
plan2.p1.z = -80;
plan2.p2.x = -80;
plan2.p2.y = 80;
plan2.p2.z = -80;
plan2.p3.x = -80;
plan2.p3.y = 80;
plan2.p3.z = 80;
plan2.p4.x = -80;
plan2.p4.y = 0;
plan2.p4.z = 80;
plan3.p1.x = 80;
plan3.p1.y = 80;
plan3.p1.z = -80;
plan3.p2.x = -80;
plan3.p2.y = 80;
plan3.p2.z = -80;
plan3.p3.x = -80;
plan3.p3.y = 0;
plan3.p3.z = -80;
plan3.p4.x = 80;
plan3.p4.y = 0;
plan3.p4.z = -80;
/* Positionnement caméra */
hauteur_camera = 10;
distance_camera_tete = 40;
camera_x = serpent.body.tab[0].p1.x;
camera_y = serpent.body.tab[0].p1.y + hauteur_camera;
camera_z = serpent.body.tab[0].p1.z + distance_camera_tete;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH);
glutInitWindowSize (1000,800);
glutCreateWindow ("Snake - Projet SAI");
glEnable(GL_DEPTH_TEST);
glutGetMenu();
glutDisplayFunc(Affichage);
glutSpecialFunc(SpecialKey);
glutMainLoop();
return 0;
}