jueves, 31 de octubre de 2013
viernes, 25 de octubre de 2013
martes, 22 de octubre de 2013
U3-ACT6-Perspectiva
codigo
GLint anchura=400;
GLint altura=400;
GLfloat arx = 0.0f;
GLfloat ary = 0.0f;
void reshape(int width, int height){
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(150.0f, (GLfloat)width/(GLfloat)height, 500.0f, 8.0f);
//glOrtho(-40,40,-40,40,-40,40);
glMatrixMode(GL_MODELVIEW);
anchura = width;
altura = height;
}
void DibujaCaras(void)
{
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,9.8,9.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(-3.5,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,3.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,9.8,9.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(3.8,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,3.8);
glVertex3f(3.8,9.8,9.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,3.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,3.5,9.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,3.5,9.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,3.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,3.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,3.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,-3.8,9.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,3.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,3.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
//1c-i
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,-3.5);
glVertex3f(3.8,9.8,3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,-3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-9.8,-3.5,3.5);
glVertex3f(-9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,-3.5);
glVertex3f(9.8,3.5,3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,-3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,-3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,-3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,-3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
//1-i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-3.8,9.8,-9.8);
glVertex3f(-3.8,3.8,-9.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(3.5,9.8,-9.8);
glVertex3f(3.5,3.8,-9.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-9.8);
glEnd();
//1-d
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(3.8,9.8,-9.8);
glVertex3f(9.8,9.8,-9.8);
glVertex3f(9.8,3.8,-9.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,-9.8);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,-9.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(9.8,3.8,-9.8);
glEnd();
//2i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-3.8,3.5,-9.8);
glVertex3f(-3.8,-3.5,-9.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
//2c
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(3.5,3.5,-9.8);
glVertex3f(3.5,-3.5,-9.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(9.8,3.5,-9.8);
glVertex3f(9.8,-3.5,-9.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,-9.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(9.8,-3.5,-9.8);
glEnd();
//3i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-3.8,-3.8,-9.8);
glVertex3f(-3.8,-9.8,-9.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,-9.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
//3c
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(3.5,-3.8,-9.8);
glVertex3f(3.5,-9.8,-9.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,-9.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
//3d
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(9.8,-3.8,-9.8);
glVertex3f(9.8,-9.8,-9.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,-9.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,-9.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
//--------------------------------------------------------------- Relleno
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-3.8,9.8,3.8);
glVertex3f(-3.8,3.8,3.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.8,9.8,3.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,9.8,2.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(-3.5,3.8,2.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,3.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,9.8,3.8);
glVertex3f(3.8,9.8,9.8);
glVertex3f(3.8,3.8,9.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,3.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(3.8,3.8,9.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(-3.5,3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,3.5,3.8);
glVertex3f(3.8,3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,3.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(3.5,-3.8,3.8);
glVertex3f(3.5,-9.8,3.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(9.8,-3.8,3.8);
glVertex3f(9.8,-9.8,3.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(3.8,-3.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-3.8,9.8,-3.5);
glVertex3f(-3.8,3.8,-3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.8,9.8,-3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,-3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,-3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(3.8,3.8,3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-3.8,3.5,3.5);
glVertex3f(-3.8,3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,-3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(3.8,-3.5,3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(3.5,-3.8,-3.5);
glVertex3f(3.5,-9.8,-3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(9.8,-3.8,-3.5);
glVertex3f(9.8,-9.8,-3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-3.8);
glVertex3f(-3.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-2.8,7.8,-7.8);
glVertex3f(-2.8,7.8,-2.8);
glVertex3f(-2.8,2.8,-2.8);
glVertex3f(-2.8,2.8,-7.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,-9.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,-9.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,-9.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,3.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,3.8);
glVertex3f(3.5,9.8,3.8);
glVertex3f(3.5,3.8,3.8);
glVertex3f(-3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,3.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(-3.5,3.8,9.8);
glVertex3f(-3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,3.8);
glVertex3f(9.8,9.8,3.8);
glVertex3f(9.8,3.8,3.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-3.8,3.5,3.8);
glVertex3f(-3.8,-3.5,3.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.5,3.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.5,3.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(3.5,3.5,3.8);
glVertex3f(3.5,-3.5,3.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(-3.5,3.5,9.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.5,3.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.5,3.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.8);
glVertex3f(9.8,3.5,3.8);
glVertex3f(9.8,-3.5,3.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.8);
glVertex3f(3.8,3.5,9.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-3.8,-3.8,3.8);
glVertex3f(-3.8,-9.8,3.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,3.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,3.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(3.8,-3.8,9.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,-3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(3.5,9.8,-3.5);
glVertex3f(3.5,3.8,-3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,-3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-3.5);
glVertex3f(9.8,9.8,-3.5);
glVertex3f(9.8,3.8,-3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(3.8,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-3.5);
glVertex3f(3.8,9.8,3.5);
glVertex3f(3.8,3.8,3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-3.8,3.5,-3.5);
glVertex3f(-3.8,-3.5,-3.5);
glVertex3f(-9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-3.8,3.5,3.5);
glVertex3f(-3.8,-3.5,3.5);
glVertex3f(-9.8,-3.5,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-3.5);
glVertex3f(9.8,3.5,-3.5);
glVertex3f(9.8,-3.5,-3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.5);
glVertex3f(9.8,3.5,3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(2.8,-3.5,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-3.5);
glVertex3f(3.8,3.5,3.5);
glVertex3f(3.8,-3.5,3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-3.8,-3.8,-3.5);
glVertex3f(-3.8,-9.8,-3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,-3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,-3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,-9.8);
glVertex3f(-3.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,-9.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-9.8);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.5,-9.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.5,-9.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.5,-9.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.5,-9.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,-9.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,-9.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-9.8);
glEnd();
}
void display(){
glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glRotatef(arx, 1.0f, 0.0f, 0.0f);
glRotatef(ary, 0.0f, 1.0f, 0.0f);
DibujaCaras();
glFlush();
glutSwapBuffers();
}
void init()
{
glClearColor(0,0,0,0);
glEnable(GL_DEPTH_TEST);
}
void idle()
{
display();
}
void Teclado(int key, int x, int y){
switch (key){
case GLUT_KEY_UP:arx-=30.00f;
break;
case GLUT_KEY_DOWN:arx+=30.00f;
break;
case GLUT_KEY_RIGHT:ary+=30.00f;
break;
case GLUT_KEY_LEFT:ary-=30.00f;
break;
}
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowPosition(400,200);
glutInitWindowSize(400,250);
glutCreateWindow("Ruben De La Cruz Venegas");
init();glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutIdleFunc(idle);
glutSpecialFunc(Teclado);
glutMainLoop();
return 0;}
lunes, 14 de octubre de 2013
U3-ACT5-Investigacion Disney Sobre Display Tactil 3D
Investigadores de Disney han desarrollado un algoritmo para la representación táctil de características y texturas tridimensionales ( 3D ) . Al alterar la fricción encontrada en forma de deslizamiento de la punta de los dedos de un usuario a través de la superficie , el algoritmo de Disney crea una percepción de un bache en 3D en una superficie táctil sin tener que desplazarse físicamente a la superficie.
" Si podemos extender artificialmente la piel en un dedo mientras se desliza en la pantalla táctil , el cerebro se deje engañar en pensar un golpe físico real es en una pantalla táctil , aunque la superficie táctil es completamente lisa ", dice Ivan Poupyrev, investigador de Disney .
Durante las pruebas , los investigadores utilizaron electrovibración para modular la fricción entre el dedo deslizante y la superficie de contacto con fuerzas electrostáticas . Además , los investigadores crearon y validaron un modelo psicofísico que simula estrechamente las fuerzas de fricción percibidas por el dedo humano cuando se desliza sobre un bache real.
"Con nuestro algoritmo no tenemos uno o dos efectos , sino un conjunto de controles que permitan ajustar los efectos táctiles a un artefacto visual específica sobre la marcha ", señala Ali Israr .
Los investigadores están presentando sus trabajos en el Simposio ACM de software de interfaz de usuario y la tecnología esta semana en St. Andrews , Escocia.
viernes, 11 de octubre de 2013
U3-ACTIVIDA4-Cubo Rubik
codigo
#include <GL/glut.h>
GLfloat arx = 0.0f;
GLfloat ary = 0.0f;
void reshape(int width, int height){
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-40,40,-40,40,-40,40);
glMatrixMode(GL_MODELVIEW);
}
void DibujaCaras(void)
{
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-9.8,9.8,9.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,9.8,9.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(-3.5,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,3.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,9.8,9.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(3.8,3.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,3.8);
glVertex3f(3.8,9.8,9.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,9.8,3.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,3.8);
glVertex3f(9.8,9.8,9.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,3.5,9.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,3.5,9.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,3.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);//
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,3.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,9.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,3.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,1.0f);// azul
glVertex3f(3.8,-3.8,9.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,3.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,3.8);
glVertex3f(9.8,-9.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
//1c-i
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,-3.5);
glVertex3f(3.8,9.8,3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,-3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-9.8,-3.5,3.5);
glVertex3f(-9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,-3.5);
glVertex3f(9.8,3.5,3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,-3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,-3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,-3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,-3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
//1-i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-3.8,9.8,-9.8);
glVertex3f(-3.8,3.8,-9.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-9.8,9.8,-9.8);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(3.5,9.8,-9.8);
glVertex3f(3.5,3.8,-9.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-9.8);
glEnd();
//1-d
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(3.8,9.8,-9.8);
glVertex3f(9.8,9.8,-9.8);
glVertex3f(9.8,3.8,-9.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f, 1.0f, 0.0f); // verde
glVertex3f(3.8,9.8,-9.8);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,9.8,-9.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(9.8,3.8,-9.8);
glEnd();
//2i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-3.8,3.5,-9.8);
glVertex3f(-3.8,-3.5,-9.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
//2c
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(3.5,3.5,-9.8);
glVertex3f(3.5,-3.5,-9.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(9.8,3.5,-9.8);
glVertex3f(9.8,-3.5,-9.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,3.5,-9.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(9.8,-3.5,-9.8);
glEnd();
//3i
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-3.8,-3.8,-9.8);
glVertex3f(-3.8,-9.8,-9.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.5f, 0.0f, 1.0f); //morado
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(-3.8,-9.8,-9.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-9.8);
glEnd();
//3c
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(3.5,-3.8,-9.8);
glVertex3f(3.5,-9.8,-9.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(3.5,-9.8,-9.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
//3d
glBegin(GL_POLYGON);
glColor3f(1.0f, 1.0f, 0.0f); // amarillo
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(9.8,-3.8,-9.8);
glVertex3f(9.8,-9.8,-9.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.0f, 0.0f); // rojo
glVertex3f(9.8,-3.8,-9.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(9.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0f,1.0f,1.0f);//blanco
glVertex3f(9.8,-9.8,-9.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
//--------------------------------------------------------------- Relleno
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,3.8);
glVertex3f(-3.8,9.8,3.8);
glVertex3f(-3.8,3.8,3.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.8,9.8,3.8);
glVertex3f(-3.8,9.8,9.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,9.8,2.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(-3.5,9.8,9.8);
glVertex3f(-3.5,3.8,2.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,3.8);
glVertex3f(3.5,9.8,9.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,9.8,3.8);
glVertex3f(3.8,9.8,9.8);
glVertex3f(3.8,3.8,9.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,3.8);
glVertex3f(9.8,3.8,9.8);
glVertex3f(3.8,3.8,9.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-9.8,3.5,9.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(-3.5,3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,3.5,3.8);
glVertex3f(3.8,3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,3.8);
glVertex3f(9.8,-3.5,9.8);
glVertex3f(3.8,-3.5,9.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-9.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(3.5,-3.8,3.8);
glVertex3f(3.5,-9.8,3.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(-3.5,-9.8,9.8);
glVertex3f(-3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(9.8,-3.8,3.8);
glVertex3f(9.8,-9.8,3.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(3.8,-3.8,9.8);
glVertex3f(3.8,-9.8,9.8);
glVertex3f(3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,-3.5);
glVertex3f(-3.8,9.8,-3.5);
glVertex3f(-3.8,3.8,-3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.8,9.8,-3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,-3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,-3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(3.8,3.8,3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-3.8,3.5,3.5);
glVertex3f(-3.8,3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,-3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(3.8,-3.5,3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(3.5,-3.8,-3.5);
glVertex3f(3.5,-9.8,-3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(9.8,-3.8,-3.5);
glVertex3f(9.8,-9.8,-3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,9.8,-3.8);
glVertex3f(-3.8,9.8,-3.8);
glVertex3f(-3.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-2.8,7.8,-7.8);
glVertex3f(-2.8,7.8,-2.8);
glVertex3f(-2.8,2.8,-2.8);
glVertex3f(-2.8,2.8,-7.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.5,9.8,-9.8);
glVertex3f(3.5,9.8,-3.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(9.8,9.8,-3.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,3.8,-9.8);
glVertex3f(9.8,3.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,3.5,-9.8);
glVertex3f(-9.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(9.8,-3.5,-9.8);
glVertex3f(9.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-9.8,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-9.8,-3.8,-9.8);
glVertex3f(-9.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0f,0.0f,0.0f);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,3.8);
glVertex3f(-3.8,3.8,9.8);
glVertex3f(-9.8,3.8,9.8);
glVertex3f(-9.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,3.8);
glVertex3f(3.5,9.8,3.8);
glVertex3f(3.5,3.8,3.8);
glVertex3f(-3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,3.8);
glVertex3f(3.5,3.8,9.8);
glVertex3f(-3.5,3.8,9.8);
glVertex3f(-3.5,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,3.8);
glVertex3f(9.8,9.8,3.8);
glVertex3f(9.8,3.8,3.8);
glVertex3f(3.8,3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,3.8);
glVertex3f(-3.8,3.5,3.8);
glVertex3f(-3.8,-3.5,3.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.5,3.8);
glVertex3f(-3.8,3.5,9.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.5,3.8);
glVertex3f(-3.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,9.8);
glVertex3f(-9.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(3.5,3.5,3.8);
glVertex3f(3.5,-3.5,3.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,3.8);
glVertex3f(-3.5,3.5,9.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.5,3.8);
glVertex3f(3.5,3.5,9.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.5,3.8);
glVertex3f(3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,9.8);
glVertex3f(-3.5,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.8);
glVertex3f(9.8,3.5,3.8);
glVertex3f(9.8,-3.5,3.8);
glVertex3f(3.8,-3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.8);
glVertex3f(3.8,3.5,9.8);
glVertex3f(9.8,3.5,9.8);
glVertex3f(9.8,3.5,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,3.8);
glVertex3f(-3.8,-3.8,3.8);
glVertex3f(-3.8,-9.8,3.8);
glVertex3f(-9.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,3.8);
glVertex3f(-3.8,-3.8,9.8);
glVertex3f(-3.8,-9.8,9.8);
glVertex3f(-3.8,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,3.8);
glVertex3f(-3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,3.8);
glVertex3f(3.5,-3.8,9.8);
glVertex3f(3.5,-9.8,9.8);
glVertex3f(3.5,-9.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,3.8);
glVertex3f(3.8,-3.8,9.8);
glVertex3f(9.8,-3.8,9.8);
glVertex3f(9.8,-3.8,3.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,9.8,3.5);
glVertex3f(-3.8,9.8,3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,-3.5);
glVertex3f(-3.8,3.8,3.5);
glVertex3f(-9.8,3.8,3.5);
glVertex3f(-9.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(3.5,9.8,-3.5);
glVertex3f(3.5,3.8,-3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(3.5,9.8,3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-3.5);
glVertex3f(-3.5,9.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,-3.5);
glVertex3f(3.5,3.8,3.5);
glVertex3f(-3.5,3.8,3.5);
glVertex3f(-3.5,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-3.5);
glVertex3f(9.8,9.8,-3.5);
glVertex3f(9.8,3.8,-3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,3.5);
glVertex3f(9.8,9.8,3.5);
glVertex3f(9.8,3.8,3.5);
glVertex3f(3.8,3.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-3.5);
glVertex3f(3.8,9.8,3.5);
glVertex3f(3.8,3.8,3.5);
glVertex3f(3.8,3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,-3.5);
glVertex3f(-3.8,3.5,-3.5);
glVertex3f(-3.8,-3.5,-3.5);
glVertex3f(-9.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,3.5,3.5);
glVertex3f(-3.8,3.5,3.5);
glVertex3f(-3.8,-3.5,3.5);
glVertex3f(-9.8,-3.5,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-3.5);
glVertex3f(9.8,3.5,-3.5);
glVertex3f(9.8,-3.5,-3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,3.5);
glVertex3f(9.8,3.5,3.5);
glVertex3f(9.8,-3.5,3.5);
glVertex3f(2.8,-3.5,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-3.5);
glVertex3f(3.8,3.5,3.5);
glVertex3f(3.8,-3.5,3.5);
glVertex3f(3.8,-3.5,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,-3.5);
glVertex3f(-3.8,-3.8,-3.5);
glVertex3f(-3.8,-9.8,-3.5);
glVertex3f(-9.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-9.8,-3.8,3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-9.8,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,-3.5);
glVertex3f(-3.8,-3.8,3.5);
glVertex3f(-3.8,-9.8,3.5);
glVertex3f(-3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(-3.5,-9.8,3.5);
glVertex3f(-3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-3.5);
glVertex3f(-3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,-3.5);
glVertex3f(3.5,-3.8,3.5);
glVertex3f(3.5,-9.8,3.5);
glVertex3f(3.5,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-9.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(3.8,-9.8,3.5);
glVertex3f(3.8,-9.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-3.5);
glVertex3f(3.8,-3.8,3.5);
glVertex3f(9.8,-3.8,3.5);
glVertex3f(9.8,-3.8,-3.5);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.8,-9.8);
glVertex3f(-3.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-3.8);
glVertex3f(-9.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,9.8,-9.8);
glVertex3f(-3.5,9.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.8,-9.8);
glVertex3f(3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-3.8);
glVertex3f(-3.5,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,9.8,-9.8);
glVertex3f(3.8,9.8,-3.8);
glVertex3f(3.8,3.8,-3.8);
glVertex3f(3.8,3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,3.5,-9.8);
glVertex3f(-3.8,3.5,-3.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.5,-9.8);
glVertex3f(-3.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-3.8);
glVertex3f(-9.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,3.5,-9.8);
glVertex3f(-3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,3.5,-9.8);
glVertex3f(3.5,3.5,-3.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.5,-9.8);
glVertex3f(3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-3.8);
glVertex3f(-3.5,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(3.8,-3.5,-3.8);
glVertex3f(3.8,-3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,3.5,-9.8);
glVertex3f(3.8,3.5,-3.8);
glVertex3f(9.8,3.5,-3.8);
glVertex3f(9.8,3.5,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.8,-3.8,-9.8);
glVertex3f(-3.8,-3.8,-3.8);
glVertex3f(-3.8,-9.8,-3.8);
glVertex3f(-3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(-3.5,-9.8,-3.8);
glVertex3f(-3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(-3.5,-3.8,-9.8);
glVertex3f(-3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-3.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.5,-3.8,-9.8);
glVertex3f(3.5,-3.8,-3.8);
glVertex3f(3.5,-9.8,-3.8);
glVertex3f(3.5,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(3.8,-9.8,-3.8);
glVertex3f(3.8,-9.8,-9.8);
glEnd();
glBegin(GL_POLYGON);
glVertex3f(3.8,-3.8,-9.8);
glVertex3f(3.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-3.8);
glVertex3f(9.8,-3.8,-9.8);
glEnd();
}
void display(){
glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glRotatef(arx, 1.0f, 0.0f, 0.0f);
glRotatef(ary, 0.0f, 1.0f, 0.0f);
DibujaCaras();
glFlush();
glutSwapBuffers();
}
void init()
{
glClearColor(0,0,0,0);
glEnable(GL_DEPTH_TEST);
}
void idle()
{
display();
}
void Teclado(int key, int x, int y){
switch (key){
case GLUT_KEY_UP:arx-=30.00f;
break;
case GLUT_KEY_DOWN:arx+=30.00f;
break;
case GLUT_KEY_RIGHT:ary+=30.00f;
break;
case GLUT_KEY_LEFT:ary-=30.00f;
break;
}
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowPosition(400,200);
glutInitWindowSize(400,250);
glutCreateWindow("Ruben De La Cruz Venegas");
init();glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutIdleFunc(idle);
glutSpecialFunc(Teclado);
glutMainLoop();
return 0;}
capturas
Suscribirse a:
Entradas (Atom)