jueves, 10 de octubre de 2013

Actividad #4 Unidad III Programa, Objeto Solido

Programa - Módem
// modem.cpp: define el punto de entrada de la aplicación de consola.
//
#include "stdafx.h"

#include <stdlib.h>
#include <GL/glut.h>

GLfloat x1= 1.5f;
GLfloat y1 = 1.5f;
GLfloat escalar = 1.5f;


int banderax; // bandera = 1;- en +X,bandera = 0;- en -X
int banderay;// bandera = 1;- en +Y,bandera = 0;- en -Y


GLfloat angulox = 0.0f; // variable para el angulo x
GLfloat anguloy = 0.0f; // variable para el angulo y
GLfloat anguloz = 0.0f; // variable para el angulo z


void reshape(int width, int height)/*Esta acción afecta en principio directamente al render, puesto que se está cambiando el tamaño del plano de proyección.*/
{
 glViewport(0,0,width,height);
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 glOrtho(-120,120,-60,60,-70,70);/*define la proyección definida por los ejes x,y,z. Estos parámetros demilitan el volumen de vista y son, por este orden: x_mínima, x_máxima, y_mínima, y_máxima, z_mínima, z_máxima,*/
 glMatrixMode(GL_MODELVIEW);

}

void modem_rayas(void)
{
  //===============================tapa
 glColor3f(1,0,0);//color rojo
 glBegin(GL_LINE_LOOP);// adelante
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(4,3.75f,0); //Vertice 2
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glVertex3f(4.5f,4,0); //Vertice 4
 glVertex3f(28.5f,4,0); //Vertice 5
 glVertex3f(28.8,3.9,0); //Vertice 6
 glVertex3f(29,3.75f,0); //Vertice 7
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();

 glBegin(GL_LINE_LOOP); //lado izq #1
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4,3.75f,0); //Vertice 2
 glEnd();

 glBegin(GL_LINE_LOOP); //lado izq #2
 glVertex3f(4,3.75f,0); //Vertice 2
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glEnd();

 glBegin(GL_LINE_LOOP);//lado izq #3
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(4.5f,4,0); //Vertice 4
 glEnd();

 glBegin(GL_LINE_LOOP);//tapa
 glVertex3f(4.5f,4,0); //Vertice 4
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.5f,4,0); //Vertice 5

 glEnd();

 glBegin(GL_LINE_LOOP);//lado der #1
 glVertex3f(28.5f,4,0); //Vertice 5
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.8,3.9,17); //Vertice 6'
 glVertex3f(28.8,3.9,0); //Vertice 6
 glEnd();

 glBegin(GL_LINE_LOOP);//lado der #2
 glVertex3f(28.8,3.9f,0); //Vertice 6
  glVertex3f(28.8,3.9f,17); //Vertice 6'
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29,3.75f,0); //Vertice 7
 glEnd();

 glBegin(GL_LINE_LOOP);//lado der #3
 glVertex3f(29,3.75f,0); //Vertice 7
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();


 glBegin(GL_LINE_LOOP);//base
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();


 glBegin(GL_LINE_LOOP);//atras
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.8,3.9,17); //Vertice 6'
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glEnd();

 //=============================centro

 glBegin(GL_LINE_LOOP);//adelante
 //glColor3f(0.1f,0.5f,0.0f);
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3,1.1f,0); //Vertice n
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glVertex3f(3,2.9f,0); //Vertice p
 glVertex3f(3.5f,3,0); //Vertice q
 glVertex3f(29.5f,3,0); //Vertice r
 glVertex3f(30,2.9f,0); //Vertice s
 glVertex3f(30.5,2.5f,0); //Vertice t
 glVertex3f(30.5,1.5f,0); //Vertice u
 glVertex3f(30,1.1f,0); //Vertice v
 glVertex3f(29.5,1,0); //Vertice w

 glEnd();

 glBegin(GL_LINE_LOOP);// lado izq #1
 // glColor3f(0.1f,0.5f,0.0f);
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(3,1.1f,0); //Vertice n
 glEnd();

 glBegin(GL_LINE_LOOP);// lado izq #2
 glVertex3f(3,1.1f,0); //Vertice n
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glEnd();

 glBegin(GL_LINE_LOOP);// lado izq #3
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glEnd();

 glBegin(GL_LINE_LOOP);// lado izq #4
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3,2.9f,0); //Vertice p
 glEnd();

 glBegin(GL_LINE_LOOP);// lado izq #5
 glVertex3f(3,2.9f,0); //Vertice p
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(3.5f,3,0); //Vertice q
 glEnd();


 glBegin(GL_LINE_LOOP);// tapa
 glVertex3f(3.5f,3,0); //Vertice q
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(29.5f,3,0); //Vertice r
 glEnd();

 /*glBegin(GL_POLYGON);// base
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(29.5,1,17); //Vertice w'
 glVertex3f(29.5,1,0); //Vertice w
 glEnd();*/

 glBegin(GL_LINE_LOOP);//atras
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(29.5,1,17); //Vertice w'
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der #1
 glVertex3f(29.5f,3,0); //Vertice r
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30,2.9f,0); //Vertice s
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der #2
 glVertex3f(30,2.9f,0); //Vertice s
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,2.5f,0); //Vertice t
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der #3
 glVertex3f(30.5,2.5f,0); //Vertice t
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30.5,1.5f,0); //Vertice u
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der #4
 glVertex3f(30.5,1.5f,0); //Vertice u
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(30,1.1f,0); //Vertice v
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der #5
 glVertex3f(30,1.1f,0); //Vertice v
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(29.5,1,17); //Vertice w'
 glVertex3f(29.5,1,0); //Vertice w
 glEnd();

 //==========================Base
 glBegin(GL_LINE_LOOP);//adelante
 //glColor3f(1.0f,1.0f,1.0f);
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glVertex3f(4,0.25f,0); //Vertice c
 glVertex3f(3.5f,1,0); //Vertice d
 glVertex3f(29.5f,1,0); //Vertice e
 glVertex3f(29,0.25,0); //Vertice f
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_LINE_LOOP);// lado #1
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glEnd();

 glBegin(GL_LINE_LOOP);//lado izq#2
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(4,0.25f,0); //Vertice c
 glEnd();

 glBegin(GL_LINE_LOOP);//lado izq #3
 glVertex3f(4,0.25f,0); //Vertice c
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(3.5f,1,0); //Vertice d
 glEnd();


/* glBegin(GL_POLYGON);//tapa
 glVertex3f(3.5f,1,0); //Vertice d
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29.5f,1,0); //Vertice e
 glEnd();*/


 glBegin(GL_LINE_LOOP);//lado der #1
 glVertex3f(29.5f,1,0); //Vertice e
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(29,0.25,0); //Vertice f
 glEnd();

 glBegin(GL_LINE_LOOP);//lado der #2
 glVertex3f(29,0.25,0); //Vertice f
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glEnd();

 glBegin(GL_LINE_LOOP);// lado der 3
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.5f,0,17); //Vertice h'
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_LINE_LOOP); //base
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(28.5f,0,17); //Vertice h'
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_LINE_LOOP);//atras
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.5f,0,17); //Vertice h'
 glEnd();



 //-----------------------------------Etiquetas Centro
 glBegin(GL_LINE_LOOP);
 //glColor3f(0.0f,0.0f,0.0f);
 glVertex3f(4.5f,1.3f,0); // vertice etiqueta modem e1
 glVertex3f(4.5f,2.8f,0); // vertice etiqueta modem e2
 glVertex3f(28.5f,2.8f,0); // vertice etiqueta modem e3
 glVertex3f(28.5f,1.3f,0); // vertice etiqueta modem e4
 glEnd();

 glBegin(GL_LINE_LOOP);
 glVertex3f(6,1.6f,-0.011); // vertice centro de la etiqueta modem ce1
 glVertex3f(5.7f,1.8,-0.011); // vertice centro de la etiqueta modem ce2
 glVertex3f(5.5f,2,-0.011); // vertice centro de la etiqueta modem ce3
 glVertex3f(5.7f,2.2f,-0.011); // vertice centro de la etiqueta modem ce4
 glVertex3f(6,2.4f,-0.011); // vertice centro de la etiqueta modem ce5
 glVertex3f(27,2.4f,-0.011); // vertice centro de la etiqueta modem ce6
 glVertex3f(27.3f,2.2f,-0.011); // vertice centro de la etiqueta modem ce7
 glVertex3f(27.5f,2,-0.011); // vertice centro de la etiqueta modem ce8
 glVertex3f(27.3f,1.8f,-0.011); // vertice centro de la etiqueta modem ce9
 glVertex3f(27,1.6f,-0.011); // vertice centro de la etiqueta modem ce10
 glEnd();

//==================Antena
//parte 1 - Rosca
   // glColor3f(1,0,0);//color rojo
glBegin(GL_LINE_LOOP);
glVertex3f(27.2,2,17); // Vertice R1
glVertex3f(26.9,2.5,17); // Vertice R2
glVertex3f(26.5f,2.6f,17); // Vertice R3
glVertex3f(26.1,2.5f,17); // Vertice R4
glVertex3f(25.8,2,17); // Vertice R5
glVertex3f(26.1,1.4f,17); // Vertice R6
glVertex3f(26.5f,1.4,17); // Vertice R7
glVertex3f(26.9f,1.4f,17); // Vertice R8
glEnd();

glColor3f(1,1,1);
    glBegin(GL_LINE_LOOP);
glVertex3f(27.2,2,17); // Vertice R1
glVertex3f(27.2,2,17.5f); // Vertice R1'
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.9,2.5,17); // Vertice R2
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.9,2.5,17); // Vertice R2
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.5f,2.6f,17); // Vertice R3
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,2.6f,17); // Vertice R3
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(26.1,2.5f,17); // Vertice R4
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.1,2.5f,17); // Vertice R4
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(25.8,2,17); // Vertice R5
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(25.8,2,17); // Vertice R5
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.1,1.4f,17); // Vertice R6
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.1,1.4f,17); // Vertice R6
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.5f,1.4,17); // Vertice R7
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,1.4,17); // Vertice R7
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.9f,1.4f,17.5f); // Vertice R8'
glVertex3f(26.9f,1.4f,17); // Vertice R8
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(27.2,2,17.5f); // Vertice R1'
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.9f,1.4f,17.5f); // Vertice R8'
glEnd();

//parte 2 - base antena
glColor3f(1,0,0);//color rojo
glBegin(GL_LINE_LOOP);
glVertex3f(27,2,17.5); // Vertice R1
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glVertex3f(26,2,17.5); // Vertice R5
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glVertex3f(26.8f,1.7f,17.5); // Vertice R8
glEnd();
glColor3f(1,1,1);//color blanco
glBegin(GL_LINE_LOOP);
glVertex3f(27,2,17.5); // Vertice R1
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26,2,17.5); // Vertice R5
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26,2,17.5); // Vertice R5
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glVertex3f(26.8f,1.7f,17.5); // Vertice R8
glEnd();
glColor3f(1,0,0);
glBegin(GL_LINE_LOOP);
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glEnd();

//uniones
glColor3f(1,1,1);
    glBegin(GL_LINE_LOOP);//#1
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glEnd();
    glBegin(GL_LINE_LOOP);
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glEnd();
    glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glEnd();
    glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26,2,19); // Vertice R5'
glEnd();
    glBegin(GL_LINE_LOOP);
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glEnd();
    glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glEnd();



glBegin(GL_LINE_LOOP);//#2
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,7.5f,20); // Vertice R4'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glEnd();
glBegin(GL_LINE_LOOP);//#2
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glEnd();
//fin uniones

//parte 3 - palito
glColor3f(1,0,0);
glBegin(GL_LINE_LOOP);//delgado
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();

glColor3f(1,1,1);//color blanco
glBegin(GL_LINE_LOOP);
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.9,9,19.5f); // Vertice PB1'
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.5f,8,20); // Vertice PB3
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.2f,8,19.8); // Vertice PB4
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.1,8,19.5); // Vertice PB5
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.2f,8,19.3); // Vertice PB6
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.5f,8,19.1); // Vertice PB7
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.8f,9,19.3); // Vertice PB8'
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();
/*glBegin(GL_LINE_LOOP);
glVertex3f(26.9,9,19.5f); // Vertice PB1'
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.8f,9,19.3); // Vertice PB8'
glEnd();
*/
glColor3f(1,0,0);
glBegin(GL_LINE_LOOP);//ancho
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glEnd();

glColor3f(1,1,1);
glBegin(GL_LINE_LOOP);
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.9,1.5f,20); // Vertice R2
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(26.1,1.5f,20); // Vertice R4
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glEnd();
glColor3f(1,0,0);
glBegin(GL_LINE_LOOP);//punta
glVertex3f(26.8,9,19.5); // Vertice R1
glVertex3f(26.7,9,19.6); // Vertice R2
glVertex3f(26.5f,9,19.7f); // Vertice R3
glVertex3f(26.4,9,19.6); // Vertice R4
glVertex3f(26.8,9,19.5); // Vertice R5
glVertex3f(26.3,9,19.4f); // Vertice R6
glVertex3f(26.5f,9,19.3); // Vertice R7
glVertex3f(26.6f,9,19.4f); // Vertice R8
glEnd();
glColor3f(1,1,1);
glBegin(GL_LINE_LOOP);
glVertex3f(26.8,9,19.5); // Vertice R1
glVertex3f(26.8,9.5f,19.5); // Vertice R1'
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.7,9,19.6); // Vertice R2
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.7,9,19.6); // Vertice R2
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.5f,9,19.7f); // Vertice R3
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,9,19.7f); // Vertice R3
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.4,9,19.6); // Vertice R4
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.4,9,19.6); // Vertice R4
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.8,9,19.5); // Vertice R5
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.8,9,19.5); // Vertice R5
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.3,9,19.4f); // Vertice R6
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.3,9,19.4f); // Vertice R6
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.5f,9,19.3); // Vertice R7
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.5f,9,19.3); // Vertice R7
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.6f,9.5f,19.4f); // Vertice R8'
glVertex3f(26.6f,9,19.4f); // Vertice R8
glEnd();
glBegin(GL_LINE_LOOP);
glVertex3f(26.8,9.5f,19.5); // Vertice R1'
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.6f,9.5f,19.4f); // Vertice R8'
glEnd();
}
void modem_relleno(void)
{
 //===============================tapa
 //glColor3f(1,1,1);//color blanco
 glBegin(GL_POLYGON);// adelante
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(4,3.75f,0); //Vertice 2
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glVertex3f(4.5f,4,0); //Vertice 4
 glVertex3f(28.5f,4,0); //Vertice 5
 glVertex3f(28.8,3.9,0); //Vertice 6
 glVertex3f(29,3.75f,0); //Vertice 7
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();

 glBegin(GL_POLYGON); //lado izq #1
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4,3.75f,0); //Vertice 2
 glEnd();

 glBegin(GL_POLYGON); //lado izq #2
 glVertex3f(4,3.75f,0); //Vertice 2
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glEnd();

 glBegin(GL_POLYGON);//lado izq #3
 glVertex3f(4.2,3.9f,0); //Vertice 3
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(4.5f,4,0); //Vertice 4
 glEnd();

 glBegin(GL_POLYGON);//tapa
 glVertex3f(4.5f,4,0); //Vertice 4
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.5f,4,0); //Vertice 5

 glEnd();

 glBegin(GL_POLYGON);//lado der #1
 glVertex3f(28.5f,4,0); //Vertice 5
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.8,3.9,17); //Vertice 6'
 glVertex3f(28.8,3.9,0); //Vertice 6
 glEnd();

 glBegin(GL_POLYGON);//lado der #2
 glVertex3f(28.8,3.9f,0); //Vertice 6
  glVertex3f(28.8,3.9f,17); //Vertice 6'
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29,3.75f,0); //Vertice 7
 glEnd();

 glBegin(GL_POLYGON);//lado der #3
 glVertex3f(29,3.75f,0); //Vertice 7
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();


 /*glBegin(GL_LINE_LOOP);//base
 glVertex3f(3.5f,3,0); // vertice 1
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glVertex3f(29.5f,3,0); //Vertice 8
 glEnd();*/


 glBegin(GL_POLYGON);//atras
 glVertex3f(3.5f,3,17); // Vertice 1'
 glVertex3f(4,3.75f,17); //Vertice 2'
 glVertex3f(4.2,3.9f,17); //Vertice 3'
 glVertex3f(4.5f,4,17); //Vertice 4'
 glVertex3f(28.5f,4,17); //Vertice 5'
 glVertex3f(28.8,3.9,17); //Vertice 6'
 glVertex3f(29,3.75f,17); //Vertice 7'
 glVertex3f(29.5f,3,17); //Vertice 8'
 glEnd();

 //=============================centro

 glBegin(GL_POLYGON);//adelante
 //glColor3f(0.1f,0.5f,0.0f);
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3,1.1f,0); //Vertice n
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glVertex3f(3,2.9f,0); //Vertice p
 glVertex3f(3.5f,3,0); //Vertice q
 glVertex3f(29.5f,3,0); //Vertice r
 glVertex3f(30,2.9f,0); //Vertice s
 glVertex3f(30.5,2.5f,0); //Vertice t
 glVertex3f(30.5,1.5f,0); //Vertice u
 glVertex3f(30,1.1f,0); //Vertice v
 glVertex3f(29.5,1,0); //Vertice w

 glEnd();

 glBegin(GL_POLYGON);// lado izq #1
 // glColor3f(0.1f,0.5f,0.0f);
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(3,1.1f,0); //Vertice n
 glEnd();

 glBegin(GL_POLYGON);// lado izq #2
 glVertex3f(3,1.1f,0); //Vertice n
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glEnd();

 glBegin(GL_POLYGON);// lado izq #3
 glVertex3f(2.5f,1.5f,0); //Vertice ñ
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glEnd();

 glBegin(GL_POLYGON);// lado izq #4
 glVertex3f(2.5f,2.5f,0); //Vertice o
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3,2.9f,0); //Vertice p
 glEnd();

 glBegin(GL_POLYGON);// lado izq #5
 glVertex3f(3,2.9f,0); //Vertice p
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(3.5f,3,0); //Vertice q
 glEnd();


 glBegin(GL_POLYGON);// tapa
 glVertex3f(3.5f,3,0); //Vertice q
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(29.5f,3,0); //Vertice r
 glEnd();

 /*glBegin(GL_POLYGON);// base
 glVertex3f(3.5f,1,0); // vertice m
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(29.5,1,17); //Vertice w'
 glVertex3f(29.5,1,0); //Vertice w
 glEnd();*/

 glBegin(GL_POLYGON);//atras
 glVertex3f(3.5f,1,17); // Vertice m'
 glVertex3f(3,1.1f,17); // Vertice n'
 glVertex3f(2.5f,1.5f,17); // Vertice ñ'
 glVertex3f(2.5f,2.5f,17); // Vertice o'
 glVertex3f(3,2.9f,17); //Vertice p'
 glVertex3f(3.5f,3,17); //Vertice q'
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(29.5,1,17); //Vertice w'
 glEnd();

 glBegin(GL_POLYGON);// lado der #1
 glVertex3f(29.5f,3,0); //Vertice r
 glVertex3f(29.5f,3,17); //Vertice r'
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30,2.9f,0); //Vertice s
 glEnd();

 glBegin(GL_POLYGON);// lado der #2
 glVertex3f(30,2.9f,0); //Vertice s
 glVertex3f(30,2.9f,17); //Vertice s'
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,2.5f,0); //Vertice t
 glEnd();

 glBegin(GL_POLYGON);// lado der #3
 glVertex3f(30.5,2.5f,0); //Vertice t
 glVertex3f(30.5,2.5f,17); //Vertice t'
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30.5,1.5f,0); //Vertice u
 glEnd();

 glBegin(GL_POLYGON);// lado der #4
 glVertex3f(30.5,1.5f,0); //Vertice u
 glVertex3f(30.5,1.5f,17); //Vertice u'
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(30,1.1f,0); //Vertice v
 glEnd();

 glBegin(GL_POLYGON);// lado der #5
 glVertex3f(30,1.1f,0); //Vertice v
 glVertex3f(30,1.1f,17); //Vertice v'
 glVertex3f(29.5,1,17); //Vertice w'
 glVertex3f(29.5,1,0); //Vertice w
 glEnd();

 //==========================Base
 glBegin(GL_POLYGON);//adelante
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glVertex3f(4,0.25f,0); //Vertice c
 glVertex3f(3.5f,1,0); //Vertice d
 glVertex3f(29.5f,1,0); //Vertice e
 glVertex3f(29,0.25,0); //Vertice f
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_POLYGON);// lado #1
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glEnd();

 glBegin(GL_POLYGON);//lado izq#2
 glVertex3f(4.2f,0.1f,0); //Vertice b
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(4,0.25f,0); //Vertice c
 glEnd();

 glBegin(GL_POLYGON);//lado izq #3
 glVertex3f(4,0.25f,0); //Vertice c
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(3.5f,1,0); //Vertice d
 glEnd();


/* glBegin(GL_POLYGON);//tapa
 glVertex3f(3.5f,1,0); //Vertice d
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29.5f,1,0); //Vertice e
 glEnd();*/


 glBegin(GL_POLYGON);//lado der #1
 glVertex3f(29.5f,1,0); //Vertice e
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(29,0.25,0); //Vertice f
 glEnd();

 glBegin(GL_POLYGON);//lado der #2
 glVertex3f(29,0.25,0); //Vertice f
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glEnd();

 glBegin(GL_POLYGON);// lado der 3
 glVertex3f(28.8f,0.1f,0); //Vertice g
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.5f,0,17); //Vertice h'
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_POLYGON); //base
 glVertex3f(4.5f,0,0); // Vertice a
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(28.5f,0,17); //Vertice h'
 glVertex3f(28.5f,0,0); //Vertice h
 glEnd();

 glBegin(GL_POLYGON);//atras
 glVertex3f(4.5f,0,17); //Vertice a'
 glVertex3f(4.2f,0.1f,17); //Vertice b'
 glVertex3f(4,0.25f,17); //Vertice c'
 glVertex3f(3.5f,1,17); //Vertice d'
 glVertex3f(29.5f,1,17); //Vertice e'
 glVertex3f(29,0.25,17); //Vertice f'
 glVertex3f(28.8f,0.1f,17); //Vertice g'
 glVertex3f(28.5f,0,17); //Vertice h'
 glEnd();



 //-----------------------------------Etiquetas Centro
 glBegin(GL_LINE_LOOP);
 glVertex3f(4.5f,1.3f,0); // vertice etiqueta modem e1
 glVertex3f(4.5f,2.8f,0); // vertice etiqueta modem e2
 glVertex3f(28.5f,2.8f,0); // vertice etiqueta modem e3
 glVertex3f(28.5f,1.3f,0); // vertice etiqueta modem e4
 glEnd();

 glBegin(GL_LINE_LOOP);
 glVertex3f(6,1.6f,-0.011); // vertice centro de la etiqueta modem ce1
 glVertex3f(5.7f,1.8,-0.011); // vertice centro de la etiqueta modem ce2
 glVertex3f(5.5f,2,-0.011); // vertice centro de la etiqueta modem ce3
 glVertex3f(5.7f,2.2f,-0.011); // vertice centro de la etiqueta modem ce4
 glVertex3f(6,2.4f,-0.011); // vertice centro de la etiqueta modem ce5
 glVertex3f(27,2.4f,-0.011); // vertice centro de la etiqueta modem ce6
 glVertex3f(27.3f,2.2f,-0.011); // vertice centro de la etiqueta modem ce7
 glVertex3f(27.5f,2,-0.011); // vertice centro de la etiqueta modem ce8
 glVertex3f(27.3f,1.8f,-0.011); // vertice centro de la etiqueta modem ce9
 glVertex3f(27,1.6f,-0.011); // vertice centro de la etiqueta modem ce10
 glEnd();

//==================Antena
//parte 1 - Rosca
glBegin(GL_POLYGON);
glVertex3f(27.2,2,17); // Vertice R1
glVertex3f(26.9,2.5,17); // Vertice R2
glVertex3f(26.5f,2.6f,17); // Vertice R3
glVertex3f(26.1,2.5f,17); // Vertice R4
glVertex3f(25.8,2,17); // Vertice R5
glVertex3f(26.1,1.4f,17); // Vertice R6
glVertex3f(26.5f,1.4,17); // Vertice R7
glVertex3f(26.9f,1.4f,17); // Vertice R8
glEnd();

    glBegin(GL_POLYGON);
glVertex3f(27.2,2,17); // Vertice R1
glVertex3f(27.2,2,17.5f); // Vertice R1'
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.9,2.5,17); // Vertice R2
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.9,2.5,17); // Vertice R2
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.5f,2.6f,17); // Vertice R3
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,2.6f,17); // Vertice R3
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(26.1,2.5f,17); // Vertice R4
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.1,2.5f,17); // Vertice R4
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(25.8,2,17); // Vertice R5
glEnd();
glBegin(GL_POLYGON);
glVertex3f(25.8,2,17); // Vertice R5
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.1,1.4f,17); // Vertice R6
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.1,1.4f,17); // Vertice R6
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.5f,1.4,17); // Vertice R7
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,1.4,17); // Vertice R7
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.9f,1.4f,17.5f); // Vertice R8'
glVertex3f(26.9f,1.4f,17); // Vertice R8
glEnd();
/*glBegin(GL_LINE_LOOP);
glVertex3f(27.2,2,17.5f); // Vertice R1'
glVertex3f(26.9,2.5,17.5f); // Vertice R2'
glVertex3f(26.5f,2.6f,17.5f); // Vertice R3'
glVertex3f(26.1,2.5f,17.5f); // Vertice R4'
glVertex3f(25.8,2,17.5f); // Vertice R5'
glVertex3f(26.1,1.4f,17.5f); // Vertice R6'
glVertex3f(26.5f,1.4,17.5f); // Vertice R7'
glVertex3f(26.9f,1.4f,17.5f); // Vertice R8'
glEnd();*/

//parte 2 - base antena
/*glBegin(GL_LINE_LOOP);
glVertex3f(27,2,17.5); // Vertice R1
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glVertex3f(26,2,17.5); // Vertice R5
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glVertex3f(26.8f,1.7f,17.5); // Vertice R8
glEnd();*/
glBegin(GL_POLYGON);
glVertex3f(27,2,17.5); // Vertice R1
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.8f,2.3f,17.5); // Vertice R2
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,2.4f,17.5); // Vertice R3
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.2f,2.3f,17.5); // Vertice R4
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26,2,17.5); // Vertice R5
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26,2,17.5); // Vertice R5
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.2f,1.7f,17.5); // Vertice R6
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,1.6f,17.5); // Vertice R7
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glVertex3f(26.8f,1.7f,17.5); // Vertice R8
glEnd();
/*glBegin(GL_LINE_LOOP);
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glEnd();*/

//uniones
    glBegin(GL_POLYGON);//#1
glVertex3f(27,2,19); // Vertice R1'
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glEnd();
    glBegin(GL_POLYGON);
glVertex3f(26.8f,2.3f,19); // Vertice R2'
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glEnd();
    glBegin(GL_POLYGON);
glVertex3f(26.5f,2.4f,19); // Vertice R3'
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glEnd();
    glBegin(GL_POLYGON);
glVertex3f(26.2f,2.3f,19); // Vertice R4'
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26,2,19); // Vertice R5'
glEnd();
    glBegin(GL_POLYGON);
glVertex3f(26,2,19); // Vertice R5'
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glEnd();
    glBegin(GL_POLYGON);
glVertex3f(26.2f,1.7f,19); // Vertice R6'
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,1.6f,19); // Vertice R7'
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glVertex3f(26.8f,1.7f,19); // Vertice R8'
glEnd();

glBegin(GL_POLYGON);//#2
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,7.5f,20); // Vertice R4'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glEnd();
glBegin(GL_POLYGON);//#2
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glEnd();
//fin uniones

//parte 3 - palito
/*glBegin(GL_LINE_LOOP);//delgado
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();*/
glBegin(GL_POLYGON);
glVertex3f(26.9,8,19.5f); // Vertice PB1
glVertex3f(26.9,9,19.5f); // Vertice PB1'
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.8f,8,19.8f); // Vertice PB2
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.5f,8,20); // Vertice PB3
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,8,20); // Vertice PB3
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.2f,8,19.8); // Vertice PB4
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.2f,8,19.8); // Vertice PB4
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.1,8,19.5); // Vertice PB5
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.1,8,19.5); // Vertice PB5
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.2f,8,19.3); // Vertice PB6
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.2f,8,19.3); // Vertice PB6
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.5f,8,19.1); // Vertice PB7
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,8,19.1); // Vertice PB7
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.8f,9,19.3); // Vertice PB8'
glVertex3f(26.8f,8,19.3); // Vertice PB8
glEnd();
/*glBegin(GL_LINE_LOOP);
glVertex3f(26.9,9,19.5f); // Vertice PB1'
glVertex3f(26.8f,9,19.8f); // Vertice PB2'
glVertex3f(26.5f,9,20); // Vertice PB3'
glVertex3f(26.2f,9,19.8); // Vertice PB4'
glVertex3f(26.1,9,19.5); // Vertice PB5'
glVertex3f(26.2f,9,19.3); // Vertice PB6'
glVertex3f(26.5f,9,19.1); // Vertice PB7'
glVertex3f(26.8f,9,19.3); // Vertice PB8'
glEnd();*/

glBegin(GL_POLYGON);//ancho
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glEnd();
glBegin(GL_POLYGON);
glVertex3f(27.1,1.5f,19.5); // Vertice R1
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.9,1.5f,20); // Vertice R2
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.9,1.5f,20); // Vertice R2
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,1.5f,20.1f); // Vertice R3
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(26.1,1.5f,20); // Vertice R4
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.1,1.5f,20); // Vertice R4
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glEnd();
glBegin(GL_POLYGON);
glVertex3f(25.9,1.5f,19.5); // Vertice R5
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.1,1.5f,18.9f); // Vertice R6
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,1.5f,18.8); // Vertice R7
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glVertex3f(26.9f,1.5f,18.9f); // Vertice R8
glEnd();
/*glBegin(GL_LINE_LOOP);
glVertex3f(27.1,7.5f,19.5); // Vertice R1'
glVertex3f(26.9,7.5f,20); // Vertice R2'
glVertex3f(26.5f,7.5f,20.1f); // Vertice R3'
glVertex3f(26.1,7.5f,20); // Vertice R4'
glVertex3f(25.9,7.5f,19.5); // Vertice R5'
glVertex3f(26.1,7.5f,18.9f); // Vertice R6'
glVertex3f(26.5f,7.5f,18.8); // Vertice R7'
glVertex3f(26.9f,7.5f,18.9f); // Vertice R8'
glEnd();*/

/*glBegin(GL_LINE_LOOP);//punta
glVertex3f(26.8,9,19.5); // Vertice R1
glVertex3f(26.7,9,19.6); // Vertice R2
glVertex3f(26.5f,9,19.7f); // Vertice R3
glVertex3f(26.4,9,19.6); // Vertice R4
glVertex3f(26.8,9,19.5); // Vertice R5
glVertex3f(26.3,9,19.4f); // Vertice R6
glVertex3f(26.5f,9,19.3); // Vertice R7
glVertex3f(26.6f,9,19.4f); // Vertice R8
glEnd();*/
glBegin(GL_POLYGON);
glVertex3f(26.8,9,19.5); // Vertice R1
glVertex3f(26.8,9.5f,19.5); // Vertice R1'
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.7,9,19.6); // Vertice R2
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.7,9,19.6); // Vertice R2
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.5f,9,19.7f); // Vertice R3
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,9,19.7f); // Vertice R3
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.4,9,19.6); // Vertice R4
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.4,9,19.6); // Vertice R4
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.8,9,19.5); // Vertice R5
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.8,9,19.5); // Vertice R5
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.3,9,19.4f); // Vertice R6
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.3,9,19.4f); // Vertice R6
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.5f,9,19.3); // Vertice R7
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.5f,9,19.3); // Vertice R7
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.6f,9.5f,19.4f); // Vertice R8'
glVertex3f(26.6f,9,19.4f); // Vertice R8
glEnd();
glBegin(GL_POLYGON);
glVertex3f(26.8,9.5f,19.5); // Vertice R1'
glVertex3f(26.7,9.5f,19.6); // Vertice R2'
glVertex3f(26.5f,9.5f,19.7f); // Vertice R3'
glVertex3f(26.4,9.5f,19.6); // Vertice R4'
glVertex3f(26.8,9.5f,19.5); // Vertice R5'
glVertex3f(26.3,9.5f,19.4f); // Vertice R6'
glVertex3f(26.5f,9.5f,19.3); // Vertice R7'
glVertex3f(26.6f,9.5f,19.4f); // Vertice R8'
glEnd();
}

void display()/*Aquí se define el primer callback. La función pasada como parámetro será llamada cada vez que GLUT determine oportuno que la ventana debe ser redibujada, como al maximizarse, poner otras ventanas por encima y después quitarlas, etc.*/
{

 glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
 //glColor3f(1.0f,0.0f,0.0f);
 //glColor3f(1,1,1);/*Define el color glColor3f(0.5,0.0,1.0);*/
 glLoadIdentity();

 glTranslatef(x1,y1,0.0f);//Se trastala en los ejes: x , y
 glScalef(escalar, escalar, escalar);//Para aunmentar y disminuir la escala
 glRotatef(angulox, 1.0f, 0.0f, 0.0f);//rotar en x
 glRotatef(anguloy, 0.0f, 1.0f, 0.0f);//rotar en y
 //glRotatef(anguloz, .0f, 0.0f, 0.0f);
 modem_rayas();

 glLoadIdentity();
 glTranslatef(x1,y1,0.0f);//Se trastala en los ejes: x , y
 glScalef(escalar, escalar, escalar);//Para aunmentar y disminuir la escala
 glRotatef(angulox, 1.0f, 0.0f, 0.0f);//rotar en x
 glRotatef(anguloy, 0.0f, 1.0f, 0.0f);//rotar en y
 //glRotatef(anguloz, .0f, 0.0f, 0.0f);
 modem_relleno();
 glFlush();/*vacía todos los comandos en estos buffers y las fuerzas de todos los comandos pendientes voluntad de ser ejecutadas inmediatamente y sin topes de espera están llenas.*/
 glutSwapBuffers();/*promueve el contenido de la memoria intermedia posterior de la capa en el uso de la ventana actual para convertirse en el contenido del búfer frontal. */
 angulox+=0.03f;
 anguloy+=0.03f;
 anguloz+=0.03f;



}
void init()
{
    glClearColor(0,0,0,0);
    glEnable(GL_DEPTH_TEST);// tapa las lineas que estan debajo de ellas
}

void idle()
{
    display();
}

void ArrowKey(int key, int x, int y){ //funcion para trasladar en -x,x,-y,y

switch (key){
case GLUT_KEY_RIGHT:
if( x1<10.0 ){x1 = x1 + 0.5;}//para moverse en la coordenada +x
if(x1>0.1 && x1<3){escalar = x1;}
break;

case GLUT_KEY_LEFT:
if( x1>-90.0 ){x1 = x1 - 0.5;}//para moverse en la coordenada -x
if(x1>0.1 && x1<3){escalar = x1;}
break;

case GLUT_KEY_UP:
if( y1<50.0 ){y1 = y1 + 0.5;}//para moverse en la coordenada +y
break;

case GLUT_KEY_DOWN:
if( y1>-50.0 ){y1 = y1 - 0.5;}//para moverse en la coordenada -y
break;
}
}
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char **argv) //Funcion para crear ventana
{
 glutInit(&argc, argv);
 glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);/*GLUT_DOUBLE para que glutSwapBuffers() tenga efecto, CON GLUT_SINGLE no hay efecto;GLUT_SINGLE para que glFlush() tenga efecto  */
 glutInitWindowPosition(500,60);//Posicion de la ventana
 glutInitWindowSize(600,500);//tamaño de la ventana
 glutCreateWindow("Módem 3D");//Mensaje de la ventana
 init();/*activa, define una serie de estados de ogl, antes de pasar el control del programa a la GLUT.*/
 glutDisplayFunc(display);
 glutReshapeFunc(reshape);
 glutIdleFunc(idle);
 glutKeyboardFunc(keyboard);
 glutSpecialFunc(ArrowKey);
 glutMainLoop();
}



No hay comentarios:

Publicar un comentario