2016年3月1日 星期二

Week 02

課堂作業1
從網址下載: sorce , date , win32 ,glut32.dll ( jsyeh.org/3dcg10 )


解壓縮win32
把 data 打開,將裡面的資料夾複製到上面解壓縮後的window32資料夾
再將 glut32.dll 移至window32資料夾


點開Shapes


課堂作業2
#include <GL/glut.h>
void display()
{
    glColor3f(1,0,0);更改茶壺顏色
    glutSolidTeapot(0.3);
    glutSwapBuffers();
}

int main(int argc,char**argv)
{
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
    glutCreateWindow("Hello 3D");
    glutDisplayFunc(display);
    glutMainLoop();
}

課堂作業3
#include <GL/glut.h>
void display()
{
    glClear(GL_COLOR_BUFFER_BIT);清背景
    glClearColor(1,1,1,1);更改背景顏色
    glColor3f(1,0,0);//茶壺
    glutSolidTeapot(0.3);
    glutSwapBuffers();
}

int main(int argc,char**argv)
{
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
    glutCreateWindow("Hello 3D");
    glutDisplayFunc(display);
    glutMainLoop();
}

沒有留言:

張貼留言