2015年3月12日 星期四

week3_02163042_王冠閔

(1).點.線.面


(2).五行程式


#include<GL/glut.h>
void display()
{
    glClearColor(0.7, 0, 0.6 ,1);

    glClear(GL_COLOR_BUFFER_BIT); //清除BUFFER
    glColor3f(1,1,1);
    glutSolidTeapot(0.5);
    glColor3f(2,1,0);
    glutSolidTeapot(0.4);
    glColor3f(0,0,1);
    glutSolidTeapot(0.3);

    glFlush();
}

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

    glutCreateWindow("02163042王冠閔");
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
}

void display()
{
    glClearColor(0.7, 0, 0.6 ,1);
    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POLYGON);
        glColor3f(1,1,0);
        glVertex2f(0,0);
        glVertex2f(1,0);
        glVertex2f(0,1);
    glEnd();
    glBegin(GL_POLYGON);
        glColor3f(1,0,0);
        glVertex2f(0,0);

        glColor3f(0,1,0);
        glVertex2f(-1,0);
        glColor3f(0,0,1);
        glVertex2f(0,-1);
     glEnd();
     glFlush();
}


(3).GLUT示範

(4).電腦圖學之父

沒有留言:

張貼留言