2016年3月1日 星期二

Week 02 張歆

作業1
複製網址 : jsyeh.org/3dcg10


將[data][win32] glut32.dll 按右鍵另存連結


將windows解壓縮


將data資料夾、glut32.dll移至windows資料夾內


打開shape 拖曳綠色的數字即可更改



作業2
開啟GLUT project  並打出上週茶壺程式碼


更改茶壺顏色 glColor3f(r,g,b);


更改背景色 glClearColor(r,g,b,a);
清除背景 glClear(GL_COLOR_BUFFER_BIT);






#include<GL/glut.h>
void display()
{
    glClearColor(r,g,b,a);  背景顏色RGB
    glClear(GL_COLOR_BUFFER_BIT);  清背景
    glColor3f(r,g,b);  茶壺顏色
    glutSolidTeapot(0.3);  大小
    glutSwapBuffers();
}
int main(int argc,char**argv)
{
    glutInit(&argc, argv); 
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("Hello 3D");  名稱
    glutDisplayFunc(display);   展示
    glutMainLoop();
}

沒有留言:

張貼留言