Ricardo Alvarez Hernandez
Logo Mitsubishi
#include <windows.h>
#include <C:\GLUT\include\GL\glut.h>
#include <stdlib.h>
#include <math.h>
void displaytri(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glPointSize(1);
glColor3f(1.0,0.0,0.0);
float x=0;
float y=0;
glBegin(GL_TRIANGLES);
x = 1;
y = 1;
glVertex2i(x,y);
x = 5;
y = 1;
glVertex2i(x,y);
x = 3;
y = 4;
glVertex2i(x,y);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(1.0,0.0,0.0);
x = 3;
y = 4;
glVertex2i(x,y);
x = 5;
y = 1;
glVertex2i(x,y);
x = 7;
y = 4;
glVertex2i(x,y);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(1.0,0.0,0.0);
x = 7;
y = 4;
glVertex2i(x,y);
x = 9;
y = 1;
glVertex2i(x,y);
x = 11;
y = 4;
glVertex2i(x,y);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(1.0,0.0,0.0);
x = 9;
y = 1;
glVertex2i(x,y);
x = 13;
y = 1;
glVertex2i(x,y);
x = 11;
y = 4;
glVertex2i(x,y);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(1.0,0.0,0.0);
x = 7;
y = 4;
glVertex2i(x,y);
x = 5;
y = 7;
glVertex2i(x,y);
x = 9;
y = 7;
glVertex2i(x,y);
glEnd();
glBegin(GL_TRIANGLES);
glColor3f(1.0,0.0,0.0);
x = 7;
y = 10;
glVertex2i(x,y);
x = 5;
y = 7;
glVertex2i(x,y);
x = 9;
y = 7;
glVertex2i(x,y);
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitWindowSize(600,600);
glutInitWindowPosition(10,50);
glutCreateWindow("Logos");
glClearColor(255.0,255.0,255.0,0);
gluOrtho2D(0,14,0,14);
glutDisplayFunc(displaytri);
glutMainLoop();
return 0;
}
Imagen:
Logo de Dominos
Codigo:
#include <windows.h>
#include <C:\GLUT\include\GL\glut.h>
#include <stdlib.h>
#include <math.h>
void displayDom(void)
{
glClear(GL_COLOR_BUFFER_BIT);
int x,y;
glPointSize(10);
glColor3f(0.0,0.0,255.0);
glBegin(GL_TRIANGLE_STRIP);
x =1;
y = 150;
glVertex2i(x,y);
x =150;
y = 1;
glVertex2i(x,y);
x =300;
y =150;
glVertex2i(x,y);
x =150;
y =300;
glVertex2i(x,y);
x =1;
y = 150;
glVertex2i(x,y);
glEnd();
//***********Parte azul
int a=0;
int b=0;
glPointSize(5);
glColor3f(255.0,255.0,255.0);
glBegin(GL_POINTS);
double radio = 35;
while(radio >= 0)
{
for(int i=0; i < 360; i =i + 1)
{
a = radio*cos(i)+80;
b = radio*sin(i)+150;
glVertex2i(a,b);
}
radio = radio - 1;
}
glBegin(GL_POINTS);
radio = 35;
while(radio >= 0)
{
for(int i=0; i < 360; i =i + 1)
{
a = radio*cos(i)+ 220;
b = radio*sin(i)+150;
glVertex2i(a,b);
}
radio = radio - 1;
}
glEnd();
//Parte roja
glPointSize(10);
glColor3f(210.0,0.0,0.0);
glBegin(GL_TRIANGLE_STRIP);
x =325;
y =175;
glVertex2i(x,y);
x =474;
y =324;
glVertex2i(x,y);
x =324;
y =474;
glVertex2i(x,y);
x =175;
y =325;
glVertex2i(x,y);
x =325;
y =175;
glVertex2i(x,y);
glEnd();
a=0;
b=0;
glPointSize(5);
glColor3f(255.0,255.0,255.0);
glBegin(GL_POINTS);
radio = 35;
while(radio >= 0)
{
for(int i=0; i < 360; i =i + 1)
{
a = radio*cos(i)+ 324;
b = radio*sin(i)+ 324;
glVertex2i(a,b);
}
radio = radio - 1;
}
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitWindowSize(600,600);
glutInitWindowPosition(10,50);
glutCreateWindow("Logos");
glClearColor(255.0,255.0,255.0,0);
gluOrtho2D(0,600,0,600);
glutDisplayFunc(displayDom);
glutMainLoop();
return 0;
}
Imagen:
No hay comentarios:
Publicar un comentario