Código Capitán América Diana Vargas

#include <windows.h>
#include <math.h>
#ifdef _APPLE_
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <math.h>
#define PI 3.1415926
#endif
float x,y;
float radio=0;
float cx=0;
float cy=0;
float dx, dy;

void estrella(float r, float g, float b){

    glColor3f(r,g,g);
    glBegin(GL_POLYGON);
    glVertex2f(-2,2);
    glVertex2f(2,2);
    glVertex2f(3,-1);
    glVertex2f(0,-3);
    glVertex2f(-3,-1);
    glEnd();

    glBegin(GL_TRIANGLES);
    glVertex2f(-2,2);
    glVertex2f(2,2);
    glVertex2f(0,6);

    glVertex2f(2,2);
    glVertex2f(3,-1);
    glVertex2f(5.5,2);

    glVertex2f(-2,2);
    glVertex2f(-3,-1);
    glVertex2f(-5.5,2);

    glVertex2f(3,-1);
    glVertex2f(0,-3);
    glVertex2f(3.8,-4.7);

    glVertex2f(0,-3);
    glVertex2f(-3,-1);
    glVertex2f(-3.8,-4.7);
    glEnd();

    glFlush();
}

void circulito (float radio, float r, float g, float b){
    glColor3f(r,g,b);
    glBegin(GL_POLYGON);
    for(float i = 0; i<=2*3.1415926; i+=0.01){
        dx = radio*cos(i)+cx;
        dy = radio*sin(i)+cy;
        glVertex2f(dx,dy);
    }
    glEnd();
}

void display(void){

    glClear(GL_COLOR_BUFFER_BIT);
    circulito(10,1,0,0);
    circulito(8.7,1,1,1);
    circulito(7.5,1,0,0);
    circulito(6,0,0,1);
    estrella(1,1,1);
    glFlush();
}

int main(int argc, char **argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
    glutInitWindowPosition(200,100);
    glutInitWindowSize(400, 400);
    glutCreateWindow("CAP AMERICA <3 | DIANA VARGAS B");

    gluOrtho2D(-12, 12, -12, 12);

    glLineWidth(5);
    //glPointSize(5);
    glClearColor(1.0,1.0,1.0,0);

    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
}


Comentarios

Entradas populares de este blog

Reflejo | Diana Vargas

Cámara | Israel González de la Peña