#include <gl/glut.

h>

#include <stdio.h>

void graficar ()
{
//printf ("hola\n");
glClear(GL_COLOR_BUFFER_BIT); //LIMPIAR PANTALLA CON EL
COLOR EPECIFICADO EN INICIALIZAR
glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);

glVertex3f(0.40, 0.20, 0); //vertices para poligono
glVertex3f(0.60, 0.20, 0);
glVertex3f(0.70, 0.40, 0);
glVertex3f(0.60,0.60,0);
glVertex3f(0.40,0.60,0);
glVertex3f(0.30,0.40,0);

glEnd();

glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(-0.20, 0.10, 0); //vertices para cuadrado
glVertex3f(-0.80, 0.10, 0);
glVertex3f(-0.80, 0.70, 0);
glVertex3f(-0.20, 0.70,0);

glEnd();

glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(-0.10, 0.0, 0); //vertices para cuadrado 1
glVertex3f(-0.70, 0.0, 0);
glVertex3f(-0.70, -0.60, 0);
glVertex3f(-0.10, -0.60,0);

glEnd();

glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(-0.5, -0.3, 0); //vertices para cuadrado 2
glVertex3f(-0.5, -0.7, 0);
glVertex3f(-0.9, -0.7, 0);
glVertex3f(-0.9, -0.3,0);

glEnd();

glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(0.4, -0.1, 0); //vertices para triangulo 1
glVertex3f(0.1, -0.6, 0);
glVertex3f(0.7, -0.6, 0);

glEnd();

0. glFlush().0.03f. glutInitWindowPosition(100. glEnd().0).100).0. glClear(GL_COLOR_BUFFER_BIT). glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB).3.h> #include <stdio.9. 1. glColor3f(1.500). 0). argv).4.95.95. } ------------------------------------------------------------------ rectangulo colores #include <gl/glut. 1).0. glBegin(GL_LINES). glVertex3f(0.0f). glutDisplayFunc(graficar). glBegin(GL_QUADS). // registro de subprograma glutMainLoop(). //LIMPIAR PANTALLA CON EL COLOR EPECIFICADO EN INICIALIZAR //glClearColor(0.0. } void inicializar() { glClearColor(1. -0. glLineWidth(3).0. glBegin(GL_LINES).03f. glVertex3f(-0. 0.0). glVertex3f(0. glVertex3f(0. glutCreateWindow("hola mundo").0. . -0.h> void graficar () { //printf ("hola\n"). glBegin(GL_LINE_LOOP).95. glVertex3f(0. -0.95.9. 1. 1. glVertex3f(0. char** argv) { glutInit(&argc.1). //ESPECFICACION DE COLOR solo para pantalla } int main (int argc. glutInitWindowSize(500. glColor3f(1. 0).6.4.03f. glEnd(). inicializar(). 0).0).1). //vertices para triangulo2 glVertex3f(0.0). glEnd(). glColor3f(0.-0.0).

//vertices para poligono glColor3f(1.03f.20. // registro de subprograma glutMainLoop(). glColor3f(0.20. 0). glClear(GL_COLOR_BUFFER_BIT). glBegin(GL_TRIANGLE_STRIP).1).03f.50. 0. } void inicializar() { glClearColor(1.h> void graficar () { //printf ("hola\n").40.1).100). glColor3f(0. //vertices para poligono glColor3f(0.0. 0.0). //LIMPIAR PANTALLA CON EL COLOR EPECIFICADO EN INICIALIZAR //glClearColor(0. 1. 0.60. 0. glVertex3f(-0.60. 0).40.0).h> #include <stdio. 0. glVertex3f(-0. glFlush().1). -0. . glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB). 0. argv).0.3. 0).0. glEnd().03f.50. glutCreateWindow("hola mundo"). glVertex3f(-0.1). 1. glutInitWindowSize(1000. 0. glColor3f(1. 0). 1.20.0f). glColor3f(1. 1). //ESPECFICACION DE COLOR solo para pantalla } int main (int argc.20.10.0. glutInitWindowPosition(100. } -------------------------- #include <gl/glut. 0). glVertex3f(-0.10. glutDisplayFunc(graficar).3.1. char** argv) { glutInit(&argc.1. 0). glVertex3f(-0. inicializar().500). glVertex3f(-0.

glEnd().1. glVertex3f(0.0. glColor3f(1.0. 0.1).9.10. glVertex3f(-0.1. glEnd().0.0. glVertex3f(0. glVertex3f(0.0). 0).2. 0).10.40.20.10. 0). . 0.0).40. glColor3f(0.0. 0). glColor3f(0.0. 0.0.1. 0.5). -0.0. glVertex3f(0. 0. 0. -0.27.3. glVertex3f(-0.9. glVertex3f(-0. glBegin(GL_POLYGON). glColor3f(0.25. glEnd().25.0.6). 0).20.2.1.20.1).0).0. 0). //vertices para poligono glColor3f(0. glVertex3f(-0. 0. //vertices para poligono glColor3f(0.0). glColor3f(0.1. glColor3f(0.9).0.20.0. 0).8.0).27. glVertex3f(0. 0).0). 0. 0). glVertex3f(-0. //vertices para poligono glColor3f(0. glColor3f(0.1.0).5.0.1. glBegin(GL_TRIANGLES). glColor3f(0. glBegin(GL_POLYGON). 0. 0). glVertex3f(0. 0).40.9. glVertex3f(0.9.0. //vertices para poligono glColor3f(0. glEnd(). 0. 0).5.2.40.10.10. 0). 0.5). glBegin(GL_TRIANGLE_STRIP).20. glColor3f(0.1.40.0).1. glVertex3f(-0.40.5). glColor3f(0. glVertex3f(-0.1.

1. glVertex3f(0. 0). 0). 0). //vertices para poligono glColor3f(0. glColor3f(0. glColor3f(1.20. glEnd().2.40.2. glVertex3f(0. glEnd().20. -0. glVertex3f(0.1).1. glColor3f(0.9. 0). -0. -0. -0. 0). -0. -0.1. glVertex3f(0. glVertex3f(0.1).20.6).20. -0.40. glEnd().1).40. glVertex3f(0. glBegin(GL_TRIANGLES).0. 0. glEnd().1. glVertex3f(0. -0.10. //vertices para poligono glColor3f(0.0.20. .9.0.5). //vertices para poligono glColor3f(0. 0). glColor3f(0. glColor3f(0.5).0.1. glColor3f(0.0. glColor3f(0. //vertices para poligono glColor3f(0. 0). 0).20.20.1). glVertex3f(0. 0.9. glBegin(GL_TRIANGLES). 0).40. 0).40.1.40.10.1.1. 0).1).1). -0.0. glColor3f(0. glVertex3f(0.0.07.1.2.0.6).10. glBegin(GL_TRIANGLES). glVertex3f(0. 0).1). -0.1.1). glBegin(GL_TRIANGLES).1.1. glColor3f(0. glVertex3f(0.0). glBegin(GL_TRIANGLES).2. glVertex3f(0.0.1. 0).0. glEnd().1. glVertex3f(0.1.

0).500). 0).1).07.1. //vertices para poligono glColor3f(0. glFlush(). glVertex3f(0. glutInitWindowPosition(100.40. glVertex3f(0.0. 0. glVertex3f(0. glEnd(). argv). 0). glutCreateWindow("hola mundo"). glColor3f(1. -0.2.0.100).1). glColor3f(1.0. 0. glutInitWindowSize(500. glutDisplayFunc(graficar ).40. } void inicializar() { glClearColor(0.20.20. 0). // registro de subprograma glutMainLoop(). inicializar().1).20. glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB). char** argv) { glutInit(&argc.0. } . //ESPECFICACION DE COLOR solo para pantalla } int main (int argc.