8. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
glVertex2d(100,350); glVertex2i(200,100);
glVertex2i(200,100);
glVertex2i(400,700);
ESTRELLA
void inicializa(void)
{
glClearColor(0.0,0.0,0.0,0.0);
//color de fondo
glMatrixMode(GL_PROJECTI
ON); //Modo de
proyeccion
glLoadIdentity();
//Establece los parametros de
proyeccion
gluOrtho2D(0.0, 1000.0, 0.0,
1000.0); //vista ortogonal
}
void dibuja(void)
//funcion dibuja
{
glClear(GL_COLOR_BUFFER
_BIT); //borra pantalla
glColor3f(1.0 , 2.0 , 3.0);
glBegin(GL_LINES);
glVertex2i(400,700);
glVertex2i(700,100);
glVertex2i(700,100);
glVertex2i(100,500);
glVertex2i(100,500);
glVertex2i(800,500);
glVertex2i(800,500);
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas
9. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
glClear(GL_COLOR_BUFFER
MOVIMIENTO
_BIT |
GL_DEPTH_BUFFER_BIT);
//abajo
if(x>=1 &&
x<500){circulo(100+1*x,100,40
);x++;}
if(w==500){ x=1;y=1; z=1;
w=1;}
int x=1, y=1,z=1,w=1;
glFlush();
void inicializa(void){
glutSwapBuffers();
glClearColor(0.0,5.0,1.0,1.0);
}
glMatrixMode(GL_PROJECTI
ON); int main (int argc, char** argv)
glLoadIdentity();
gluOrtho2D(0.0, 700.0, 0.0,
700.0);// el ancho y largo de
nuestra pantalla
}
void circulo(int x, int y, int
radio){
int angulo=0;
glBegin(GL_TRIANG
LE_FAN); glColor3f (0.1, 0.0,
1.0);
glVertex2f(x,y);
glColor3f(0,2.0,0.0);
for
(angulo=0;angulo<=360;
angulo+=6){ glVertex2f(x +
sin(angulo) * radio, y +
cos(angulo) * radio);}
glEnd();}
void dibuja(void)
{
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas
10. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
}
MOVIMIENTO
CIRCULAR void dibuja(void)
{
glClear(GL_COLOR_BUFFER
_BIT |
GL_DEPTH_BUFFER_BIT);//e
sto
glColor3f(1.0,0.0,0.0);
circulo( 600+ sin(ang) *
void inicializa(void) rad,700 + cos(ang) * rad,50);
//funcion circulo
{
glColor3f(1.0,0.0,0.0);
glClearColor(0.0,0.0,1.0,0.0);
glMatrixMode(GL_PROJECTI
ON); a+=0.5;
glLoadIdentity(); ang=ang+0.3; //velocidad
entre mas grande mas rapido
gluOrtho2D(0.0, 1000.0, 0.0, y entre menos mas lento
1000.0);// el ancho y largo de
nuestra pantalla
} for(int
j=1;j<=10000000;j++){}//pausa
if(ang==360){ang=0;}// se
void circulo(int x, int y, int repite idefinidamente
radio)
glFlush(); //forzar dibujado
{
glutSwapBuffers(); //y esto
int angulo=0;
}
glBegin(GL_TRIANG
LE_FAN); glColor3f (1.0, 0.9,
0.0);
int main (int argc, char** argv)
glVertex2f(x,y);
glColor3f(1.0,0.1,0.0);
for
(angulo=0;angulo<=360;
angulo++){ glVertex2f(x +
sin(angulo) * radio, y +
cos(angulo) * radio);}
glEnd();
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas
11. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
circulo(300,180,50);
MOVIMIENTO EN
8
glColor3f(1.0,0.9,0.0);
if(a>=6.15 && a<=12.41){
circulo(300+ sin (a)*60,300-
cos(a)*60,10);
a=a+0.06;
void circulo(int x, int y, int }
radio){
else{
int angulo=0;
circulo(300 + sin (b) *60,180-
cos(b)*-60,10);
glBegin(GL_TRIANG
b=b + 0.6;
LE_FAN);
if(b>12.4){a=6.15;b=6.15;}
glVertex2f(x,y);
for(int j=0; j<=10000000; j++)
for
{}
(angulo=0;angulo<=360;
angulo+=6){ glVertex2f(x +
}
sin(angulo) * radio, y +
cos(angulo) * radio);}
glEnd();}
void dibuja(void)
{
glClear(GL_COLOR_BUFFER
_BIT |
GL_DEPTH_BUFFER_BIT);
glColor3f(0.5, 0.8, 0.9);
circulo(300, 300, 70);
circulo(300,180,70);
glColor3f(5.0,0.9,0.0);
circulo(300,300,50);
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas
12. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
for circulo(195,400,20);
MUÑECO BONITO
(angulo=0;angulo<=360;
angulo+=1){ glVertex2f(x + circulo(305,400,20);
sin(angulo) * radio, y +
cos(angulo) * radio);} //cabeza
glEnd(); circulo(250,400,60);
} glColor3f(0.0 , 0.0 , 0.0);
circulo(230,400,20);
void circulo(int x, int y, int circulo(270,400,20);
radio)
glColor3f(0.8,0.6,0.0);
{
circulo(100,170,15);
int angulo=0;
glColor3f(0.8,0.6,0.0);
void inicializa(void) circulo(400,180,15);
glBegin(GL_TRIANG
{ LE_FAN); glEnd();
glClearColor(1.0,1.0,1.0,0.0); // glColor3f (1.0, 0.0, 1.0);
//color de fondo
glVertex2f(x,y);
glMatrixMode(GL_PROJECTI
ON); //Modo de glBegin(GL_TRIANGLES);
proyeccion
for glColor3f(0.0 ,0.0 , 0.0);
glLoadIdentity(); (angulo=0;angulo<=360;
//Establece los parametros de angulo+=1){ glVertex2f(x + glVertex2i(250,460);
proyeccion sin(angulo) * radio, y +
cos(angulo) * radio);} glVertex2i(234,480);
gluOrtho2D(0.0, 800.0, 0.0,
700.0); //vista ortogonal glEnd(); glVertex2i(225,453);
} } glColor3f(0.0 ,0.0 , 0.0);
void circuloc(int x, int y, int t, glVertex2i(225,453);
int radio)
void dibuja(void) glVertex2i(212,474);
{ //funcion dibuja
glVertex2i(205,440);
int angulo=0; {
glColor3f(0.0 ,0.0 , 0.0);
glPointSize(t); glClear(GL_COLOR_BUFFER
_BIT); glVertex2i(250,460);
glVertex2i(264,480);
glBegin(GL_POINTS)
; glVertex2i(275,453);
//glColor3f (1.0, 0.0, 1.0); glColor3f(0.0 ,0.0 , 0.0);
//orejas
glVertex2f(x,y); glVertex2i(275,453);
glColor3f(0.8,0.6,0.0);
//glColor3f(0,0.0,0.0);
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas
29. COLEGIO DE ESTUDIOS CIENTÍFICOS Y TECNOLÓGICOS PLANTEL
TECAMAC
glutSolidCube(1);
glTranslatef(0.0,-1.0,0.0);
glutSolidCube(1);
glTranslatef(-1.0,2.0,0.0);
glutSolidCube(1);
glTranslatef(-1.0,0.0,0.0);
glutSolidCube(1);
glTranslatef(-1.0,0.0,0.0);
glutSolidCube(1);
Eduardo Valdivia Solís
Marcos Daniel Tampa Hernández
Manual de Practicas