jueves, 21 de noviembre de 2013
martes, 12 de noviembre de 2013
U3-ACTIVADAD-11-INVESTIGACION
Analizador Diferencial Digital (DDA) se usa para la interpolación lineal de variables sobre un intervalo entre un punto de comienzo y un punto de fin. Los DDAs se usan para rastreo de lineas, triangulos y polígonos. En la implementación mas simple del algoritmo DDA interpola valores en intervalo [(xinicio, yinicio), (xfin, yfin)] por calculo para cada xi las ecuaciones xi = xi−1+1, yi = yi−1 + Δy/Δx, donde Δx = xfin − xinicio y Δy = yfin − yinicio.
#include <cstdlib>
#include <iostream>
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
using namespace std;
// Draw a pixel as a point.
void pickPixel(int x, int y)
{
glBegin(GL_POINTS);
glVertex2i(x, y);
glEnd();
}
// Round a float to a nearest integer.
int round(float z)
{
int y;
y = z > 0.0 ? int(z + 0.5) : int(z - 0.5);
return y;
}
// DDA line rasterizer.
void DDA(int i1, int j1, int i2, int j2) // Assume i2 > i1.
{
float y = j1;
float m = float(j2 - j1)/(i2 - i1); // Assume -1 <= m <= 1.
for(int x = i1; x <= i2; x++)
{
pickPixel(x, round(y));
y += m;
}
}
// Drawing routine.
void drawScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 0.0);
DDA(100, 100, 300, 200);
glFlush();
}
// Initialization routine.
void setup(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
}
// OpenGL window reshape routine.
void resize(int w, int h)
{
glViewport(0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// The height/width of the ortho-box match that of the OpenGL window,
// resulting in a point-to-pixel correspondence.
gluOrtho2D(0.0, 500.0, 0.0, 500.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
// Keyboard input processing routine.
void keyInput(unsigned char key, int x, int y)
{
switch(key)
{
case 27:
exit(0);
break;
default:
break;
}
}
// Main routine.
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutInitWindowPosition(100, 100);
glutCreateWindow("Ruben De La Cruz Venegas-DDA.cpp");
setup();
glutDisplayFunc(drawScene);
glutReshapeFunc(resize);
glutKeyboardFunc(keyInput);
glutMainLoop();
return 0;
}
#include <GL/glut.h>
#include <stdio.h>
#define BLACK 0
void draw_pixel(int ix, int iy, int value)
{
glBegin(GL_POINTS);
glVertex2i( ix, iy);
glEnd();
}
void bres(int x1,int y1,int x2,int y2)
{
int dx, dy, i, e;
int incx, incy, inc1, inc2;
int x,y;
dx = x2 - x1;
dy = y2 - y1;
if(dx < 0) dx = -dx;
if(dy < 0) dy = -dy;
incx = 1;
if(x2 < x1) incx = -1;
incy = 1;
if(y2 < y1) incy = -1;
x=x1;
y=y1;
if(dx > dy)
{
draw_pixel(x,y, BLACK);
e = 2*dy - dx;
inc1 = 2*( dy -dx);
inc2 = 2*dy;
for(i = 0; i < dx; i++)
{
if(e >= 0)
{
y += incy;
e += inc1;
}
else e += inc2;
x += incx;
draw_pixel(x,y, BLACK);
}
}
else
{
draw_pixel(x,y, BLACK);
e = 2*dx - dy;
inc1 = 2*( dx - dy);
inc2 = 2*dx;
for(i = 0; i < dy; i++)
{
if(e >= 0)
{
x += incx;
e += inc1;
}
else e += inc2;
y += incy;
draw_pixel(x,y, BLACK);
}
}
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
bres(200, 200, 100, 100);
glFlush();
}
void myinit()
{
glClearColor(1.0, 1.0, 1.0, 1.0);
glColor3f(1.0, 0.0, 0.0);
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 499.0, 0.0, 499.0);
}
void main(int argc, char** argv)
{
/* Inicializacion GLUT estándar*/
glutInit(&argc,argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500,500); /* ventana 500x500 pixeles */
glutInitWindowPosition(0,0); /* coloca la ventana de despliegue en esq. sup. izq */
glutCreateWindow("Ruben De La Cruz Venegas-Bresenham"); /* título de la ventana*/
glutDisplayFunc(display); /*llama a la funcion display cuando se abre la ventana */
myinit(); /* fija o establece los atributos */
glutMainLoop(); /* entra a un ciclo de evento */
}
algoritmo
Si m>=0 (pendiente positiva)
Si m<=1
de izquierda a derecha
* muestreo de x (Δx =1)
* yk+1 = redondeo(yk + m) k=1,2,...
de derecha a izquierda
* muestreo de x (Δx =-1)
* yk+1 = redondeo(yk - m) k=1,2,...
Si m > 1 (para evitar la aparición de agujeros)
de izquierda a derecha
* muestreo de y (Δy =1)
* xk+1 = redondeo(xk + 1/m) k=1,2,...
de derecha a izquierda
* muestreo de y (Δy =-1)
* xk+1 = redondeo(xk - m) k=1,2,...
Si m<0 (pendiente negativa)
Si |m|<1
de izquierda a derecha
* muestreo de x (Δx =1)
* yk+1 = redondeo(yk + m) k=1,2,...
de derecha a izquierda
* muestreo de x (Δx =-1)
* yk+1 = redondeo(yk - m) k=1,2,...
Si |m| > 1 (para evitar la aparición de agujeros)
de izquierda a derecha
* muestreo de y (Δy =1)
* xk+1 = redondeo(xk + 1/m) k=1,2,...
de derecha a izquierda
* muestreo de y (Δy =-1)
* xk+1 = redondeo(xk - m) k=1,2,...
Si m<=1
de izquierda a derecha
* muestreo de x (Δx =1)
* yk+1 = redondeo(yk + m) k=1,2,...
de derecha a izquierda
* muestreo de x (Δx =-1)
* yk+1 = redondeo(yk - m) k=1,2,...
Si m > 1 (para evitar la aparición de agujeros)
de izquierda a derecha
* muestreo de y (Δy =1)
* xk+1 = redondeo(xk + 1/m) k=1,2,...
de derecha a izquierda
* muestreo de y (Δy =-1)
* xk+1 = redondeo(xk - m) k=1,2,...
Si m<0 (pendiente negativa)
Si |m|<1
de izquierda a derecha
* muestreo de x (Δx =1)
* yk+1 = redondeo(yk + m) k=1,2,...
de derecha a izquierda
* muestreo de x (Δx =-1)
* yk+1 = redondeo(yk - m) k=1,2,...
Si |m| > 1 (para evitar la aparición de agujeros)
de izquierda a derecha
* muestreo de y (Δy =1)
* xk+1 = redondeo(xk + 1/m) k=1,2,...
de derecha a izquierda
* muestreo de y (Δy =-1)
* xk+1 = redondeo(xk - m) k=1,2,...
El algoritmo de Bresenham es un algoritmo creado para dibujar rectas en los dispositivos de gráficos rasterizados, como por ejemplo un monitor de ordenador, que determina qué pixeles se rellenarán, en función de la inclinación del ángulo de la recta a dibujar.
algoritmo
Si 0<|m|<1
*Se capturan los extremos de la línea y se almacena el extremo izquierdo en (x0,y0).
*Se carga (x0,y0) en el bufer de estructura (se traza el primer punto)
*Se calculan las constantes Δx,Δy, 2Δy y 2Δy-Δx y se obtiene el valor inicial para el
parametro de decisión p0=2Δy-Δx.
Para j=0 mientras j<Δx
*En cada xk a lo largo de la línea, que inicia en k=0 se efectúa la prueba siguiente:
Si pk<0
*Trazamos (xk+1,yk).
*Asignamos pk+1= pk+2Δy.
Sino
*Trazamos (xk+1,yk+1).
*Asignamos pk+1= pk+2Δy-2Δx.
Fin Para
Si |m|>1
*Recorremos la dirección en pasos unitarios y calculamos los valores sucesivos
de x que se aproximen más a la trayectoria de la línea.
*Se capturan los extremos de la línea y se almacena el extremo izquierdo en (x0,y0).
*Se carga (x0,y0) en el bufer de estructura (se traza el primer punto)
*Se calculan las constantes Δx,Δy, 2Δy y 2Δy-Δx y se obtiene el valor inicial para el
parametro de decisión p0=2Δy-Δx.
Para j=0 mientras j<Δx
*En cada xk a lo largo de la línea, que inicia en k=0 se efectúa la prueba siguiente:
Si pk<0
*Trazamos (xk+1,yk).
*Asignamos pk+1= pk+2Δy.
Sino
*Trazamos (xk+1,yk+1).
*Asignamos pk+1= pk+2Δy-2Δx.
Fin Para
Si |m|>1
*Recorremos la dirección en pasos unitarios y calculamos los valores sucesivos
de x que se aproximen más a la trayectoria de la línea.
EJEMPLO DDA
#include <cstdlib>
#include <iostream>
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
using namespace std;
// Draw a pixel as a point.
void pickPixel(int x, int y)
{
glBegin(GL_POINTS);
glVertex2i(x, y);
glEnd();
}
// Round a float to a nearest integer.
int round(float z)
{
int y;
y = z > 0.0 ? int(z + 0.5) : int(z - 0.5);
return y;
}
// DDA line rasterizer.
void DDA(int i1, int j1, int i2, int j2) // Assume i2 > i1.
{
float y = j1;
float m = float(j2 - j1)/(i2 - i1); // Assume -1 <= m <= 1.
for(int x = i1; x <= i2; x++)
{
pickPixel(x, round(y));
y += m;
}
}
// Drawing routine.
void drawScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 0.0);
DDA(100, 100, 300, 200);
glFlush();
}
// Initialization routine.
void setup(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
}
// OpenGL window reshape routine.
void resize(int w, int h)
{
glViewport(0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// The height/width of the ortho-box match that of the OpenGL window,
// resulting in a point-to-pixel correspondence.
gluOrtho2D(0.0, 500.0, 0.0, 500.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
// Keyboard input processing routine.
void keyInput(unsigned char key, int x, int y)
{
switch(key)
{
case 27:
exit(0);
break;
default:
break;
}
}
// Main routine.
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutInitWindowPosition(100, 100);
glutCreateWindow("Ruben De La Cruz Venegas-DDA.cpp");
setup();
glutDisplayFunc(drawScene);
glutReshapeFunc(resize);
glutKeyboardFunc(keyInput);
glutMainLoop();
return 0;
}
EJEMPLO BRESENHAN
#include <GL/glut.h>
#include <stdio.h>
#define BLACK 0
void draw_pixel(int ix, int iy, int value)
{
glBegin(GL_POINTS);
glVertex2i( ix, iy);
glEnd();
}
void bres(int x1,int y1,int x2,int y2)
{
int dx, dy, i, e;
int incx, incy, inc1, inc2;
int x,y;
dx = x2 - x1;
dy = y2 - y1;
if(dx < 0) dx = -dx;
if(dy < 0) dy = -dy;
incx = 1;
if(x2 < x1) incx = -1;
incy = 1;
if(y2 < y1) incy = -1;
x=x1;
y=y1;
if(dx > dy)
{
draw_pixel(x,y, BLACK);
e = 2*dy - dx;
inc1 = 2*( dy -dx);
inc2 = 2*dy;
for(i = 0; i < dx; i++)
{
if(e >= 0)
{
y += incy;
e += inc1;
}
else e += inc2;
x += incx;
draw_pixel(x,y, BLACK);
}
}
else
{
draw_pixel(x,y, BLACK);
e = 2*dx - dy;
inc1 = 2*( dx - dy);
inc2 = 2*dx;
for(i = 0; i < dy; i++)
{
if(e >= 0)
{
x += incx;
e += inc1;
}
else e += inc2;
y += incy;
draw_pixel(x,y, BLACK);
}
}
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
bres(200, 200, 100, 100);
glFlush();
}
void myinit()
{
glClearColor(1.0, 1.0, 1.0, 1.0);
glColor3f(1.0, 0.0, 0.0);
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 499.0, 0.0, 499.0);
}
void main(int argc, char** argv)
{
/* Inicializacion GLUT estándar*/
glutInit(&argc,argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500,500); /* ventana 500x500 pixeles */
glutInitWindowPosition(0,0); /* coloca la ventana de despliegue en esq. sup. izq */
glutCreateWindow("Ruben De La Cruz Venegas-Bresenham"); /* título de la ventana*/
glutDisplayFunc(display); /*llama a la funcion display cuando se abre la ventana */
myinit(); /* fija o establece los atributos */
glutMainLoop(); /* entra a un ciclo de evento */
}
lunes, 11 de noviembre de 2013
martes, 5 de noviembre de 2013
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)