2015年3月11日 星期三

||02160562||洪伊盈||Week 03|| 很多顏色的小茶壺 和 三角形

#include <GL/glut.h>

void display()
{
    glColor3f(0,1,1);
    glutSolidTeapot(0.3);
    glFlush();
}
int main(int argc, char **argv)
{
    glutInit(&argc,argv);

    glutCreateWindow("PAN");

    glutDisplayFunc(display);

    glutMainLoop();

}


 #include <GL/glut.h>

void display()
{
    glClearColor(1,1,1,0);
      glClear(GL_COLOR_BUFFER_BIT);

    glColor3f(1,0,1);
      glutSolidTeapot(0.5);

    glColor3f(0,0,1);
      glutSolidTeapot(0.4);

    glColor3f(0,1,1);
      glutSolidTeapot(0.3);

    glFlush();
}

int main(int argc, char **argv)
{
    glutInit(&argc,argv);

    glutCreateWindow("PAN");

    glutDisplayFunc(display);

    glutMainLoop();
}


#include <GL/glut.h>

void display()
{
   glClearColor(0,0,1,1);
   glClear(GL_COLOR_BUFFER_BIT);
   glColor3f(1,1,0);

    glBegin(GL_POLYGON);
    glColor3f(1,0,0);
    glVertex2f(-1.0,-1.0);

    glColor3f(0,1,0);
    glVertex2f(1.0,0.0);

    glColor3f(0,0,1);
    glVertex2f(0.0,1.0);

    glEnd();
    glFlush();
}

int main(int argc, char **argv)
{
    glutInit(&argc,argv);

    glutCreateWindow("PAN");

    glutDisplayFunc(display);

    glutMainLoop();
}

#include <GL/glut.h>

void display()
{
   glClearColor(0,0,1,1);
   glClear(GL_COLOR_BUFFER_BIT);
   glColor3f(1,1,0);

    glBegin(GL_POLYGON);
    glColor3f(1,0,0);
    glVertex2f(-1.0,-1.0);

    glColor3f(0,1,0);
    glVertex2f(1.0,0.0);

    glColor3f(0,0,1);
    glVertex2f(0.0,1.0);

    glEnd();
    glFlush();
}

int main(int argc, char **argv)
{
    glutInit(&argc,argv);

    glutCreateWindow("PAN");

    glutFullScreen();

    glutDisplayFunc(display);

    glutMainLoop();
}



沒有留言:

張貼留言