commit 92c9300f7c25edafe7bc11ba6d46b07dec55428a
parent aaf1594a6e65c8cac0bca9eb958a4ae2c54a8420
Author: Yoann <yoann.b87@voila.fr>
Date: Mon, 26 Sep 2011 22:06:53 +0200
Passe à la 3ème dimension de l'affichage (display.c).
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/display.c b/display.c
@@ -19,11 +19,16 @@ int main(int argc, char *argv[]) {
}
glClear(GL_COLOR_BUFFER_BIT);
-
+
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity( );
+ gluPerspective(70,(double)640/480,1,1000);
+ gluLookAt(0, 0, -3, 0, 0.75, 0, 0, 1, 0);
+
glBegin(GL_TRIANGLES);
- glColor3ub(255,0,0); glVertex2d(-0.75,-0.75);
- glColor3ub(0,255,0); glVertex2d(0,0.75);
- glColor3ub(0,0,255); glVertex2d(0.75,-0.75);
+ glColor3ub(255,0,0); glVertex3d(-0.75,-0.75,0);
+ glColor3ub(0,255,0); glVertex3d(0,0.75,0);
+ glColor3ub(0,0,255); glVertex3d(0.75,-0.75,0);
glEnd();
glFlush();