2019年3月7日 星期四

金魚腦波學W3


1.     主題:點、線、面、顏色
2.     Data32拉到window解壓縮資料夾
3.     打開shape


*big點,左鍵:Dvag數字
*不同色
polygon多邊形
vertex頂點

2.實做:第一個親手寫出的程式碼
#include <GL/glut.h>
void display()
{
    glutSolidTeapot(0.3);
    glutSwapBuffers();
}
    int main(int argc, char**argv)
    {
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
        glutCreateWindow("week03");
        glutDisplayFunc(display);
        glutMainLoop();

    }
  打開上周GLUT檔,改程式碼

新發現;茶壺改顏色,加入 glColor3f(0,1,1);
不過上面寫在第三行是錯的,glutSwapBuffers();要在最後
3.洩題:期中考題
4.回家作業


沒有留言:

張貼留言