-
Notifications
You must be signed in to change notification settings - Fork 1
/
fonctions.cpp
40 lines (34 loc) · 990 Bytes
/
fonctions.cpp
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
#include "fonctions.h"
// fonction Kapla
void box(int x, int y,int z)
{
glPushMatrix();
glScalef(x,y,z);
glBegin (GL_QUADS);
//face 1
glNormal3i(-1, 1,-1);
glVertex3i(-1, 1,-1); glVertex3i( 1, 1,-1);
glVertex3i( 1,-1,-1); glVertex3i(-1,-1,-1);
//face 2
glNormal3i(-1,-1,-1);
glVertex3i(-1,-1,-1); glVertex3i( 1,-1,-1);
glVertex3i( 1,-1, 1); glVertex3i(-1,-1, 1);
// face 3
glNormal3i( 1,-1, 1);
glVertex3i( 1,-1, 1); glVertex3i( 1,-1,-1);
glVertex3i( 1, 1,-1); glVertex3i( 1, 1, 1);
//face 4
glNormal3i( 1, 1,-1);
glVertex3i( 1, 1,-1); glVertex3i(-1, 1,-1);
glVertex3i(-1, 1, 1); glVertex3i( 1, 1, 1);
//face 5
glNormal3i(-1, 1, 1);
glVertex3i(-1, 1, 1); glVertex3i(-1, 1,-1);
glVertex3i(-1,-1,-1); glVertex3i(-1,-1, 1);
//face 6
glNormal3i( 1,-1, 1);
glVertex3i( 1,-1, 1); glVertex3i( 1, 1, 1);
glVertex3i(-1, 1, 1); glVertex3i(-1,-1, 1);
glEnd();
glPopMatrix();
}