2015年3月11日 星期三

Week03 課堂作業, 許志遙

#include <GL/glut.h>

void display(){
    glClearColor(1,0,1,1);  //增加畫面背景的顏色
    glClear(GL_COLOR_BUFFER_BIT);       //清畫面

    glColor3f(1,0,1);       //增加顏色
    glutSolidTeapot(0.5);   //畫出茶壺

    glColor3f(1,1,0);       //增加顏色
    glutSolidTeapot(0.4);   //畫出茶壺

    glColor3f(0,1,1);       //增加顏色
    glutSolidTeapot(0.3);   //畫出茶壺
    glFlush();
}

int main(int argc,char**argv){
    glutInit(&argc,argv);
    glutCreateWindow("資傳拉拉得第一");        //建立視窗
    glutDisplayFunc(display);
    glutMainLoop();
}

#include <GL/glut.h>

void display(){
    glClearColor(1,0,1,1);  //畫面背景的顏色
    glClear(GL_COLOR_BUFFER_BIT);       //清畫面
    glColor3f(1,1,0);

    glBegin(GL_POLYGON);

    glColor3f(1,0,0);
    glVertex2f(-1,-1);

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

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

    glEnd();
    glFlush();
}

int main(int argc,char**argv){
    glutInit(&argc,argv);
    glutCreateWindow("資傳拉拉絕對強");        //建立視窗
    glutDisplayFunc(display);
    glutMainLoop();
}


沒有留言:

張貼留言