Copias

Páginas: 2 (427 palabras) Publicado: 25 de marzo de 2012
INSTITUTO TECNOLÓGICO DE CIUDAD JUÁREZ

GRAFICACION.

UNIDAD I

PROYECTO.



#include<GL/glut.h>
#include<MATH.h>
void init()
{
glClearColor(1,1,1,1);//define elcolor
glOrtho(10,-10,10,-10,10,-10);//especifica las
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);//limpia la ventana de
glColor3f(0,0,0);//establece el color paraglBegin(GL_LINES);
glVertex3f(0,0,0);//vertices (x,y,z) aqui y=0,z=0
glVertex3f(-10,0,0);
glEnd();
glBegin(GL_LINES);
glVertex2f(0,-10);
glVertex2f(0,10);
glEnd();//////////////////////////////////////////////////////////////////////////////////////////////////////
glBegin(GL_POLYGON);
glColor3f(1,0,0);
glVertex2f(-5,-8);
glVertex2f(-7,-6);glVertex2f(-7,-4);
glVertex2f(-5,-2);
glVertex2f(-3,-4);
glVertex2f(-3,-6);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(0,1,0);
glVertex2f(-4,-6);glVertex2f(-6,-2);
glVertex2f(-2,-2);
glEnd();
glBegin(GL_QUADS);
glColor3f(0,0,1);
glVertex2f(-4,-4);
glVertex2f(-4,-1);
glVertex2f(-1,-1);
glVertex2f(-1,-4);glEnd();
/////////////////////////////////////////////////////////////////////////////////////////
int a=-5,b=5;
float x=0,y=0;
glBegin(GL_LINE_STRIP);
glColor3f(0,0,0);
for(int g=0;g<360; g++)
{
x=3*cos(g*(3.1416/180));
y=3*sin(g*(3.1416/180));
glVertex2f(a+x,b+y);
}
glEnd ();
glBegin(GL_LINE_LOOP);
glColor3f(0,0,0);
x=0;
y=0;
for(inth=0; h<360; h++)
{
x=3*cos(h*(3.1416/180));
y=3*sin(h*(3.1416/180));
glVertex2f(-6+x,b+y);
}
glEnd();
glBegin(GL_LINE_LOOP);
glColor3f(0,0,0);
x=0;
y=0;
for(intc=0; c<360; c++)
{
x=3*cos(c*(3.1416/180));
y=3*sin(c*(3.1416/180));
glVertex2f(-4+x,b+y);
}
glEnd();

glBegin(GL_LINE_LOOP);
glColor3f(0,0,0);
glVertex2f(-5,2);...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Copia.
  • Copia
  • Copiar
  • la copia
  • Copie
  • Copias
  • Copia
  • Copiar

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS