2020年3月11日 星期三

Week 2 _

- Review Week1 -

複習上星期的課程


- GLUT Teapot -

把GLUT的程式碼改成
#include <GL/glut.h>
void display()
{
    glColor3f(0,0,1);
    glutSolidTeapot(0.3);//畫出茶壺
    glutSwapBuffers();
}
int main(int argc,char**argv)
{
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
    glutCreateWindow("Week2");

    glutDisplayFunc(display);
    glutMainLoop();
}


- GLUT Shapes -




- GLUT Polygon -

把GLUT的程式碼改成
#include <GL/glut.h>
void display()
{
    glBegin(GL_POLYGON); //畫出凸多邊形
        glColor3f(0,0,1);glVertex2f(1,0);
        glColor3f(0,1,0);glVertex2f(-1,-1);
        glColor3f(1,0,0);glVertex2f(-1,1);
    glEnd();
    glutSwapBuffers();
}
int main(int argc,char**argv)
{
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
    glutCreateWindow("Week2");

    glutDisplayFunc(display);
    glutMainLoop();
}


- GLUT Line Loop -


沒有留言:

張貼留言