1.建立點.線.面.色彩
(1)先到http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/ 下載三個檔案
data.
win32.
glut32.dll
(2)把windows檔解壓縮並打開shapes檔
(3)點右鍵選PLOYGON
(4)完成
2.複習上週程式(茶壺)
3.把茶壺上色
多加glColor3f(1,0,0); //紅
glColor3f(0,1,0); //綠
glColor3f(0,0,1); //藍
4.有顏色的三角形
刪除glutSolidTeapot(0.3);
多加glBegin(GL_POLYGON);
glColor3f(1,0,0);
glVertex3f(0,0,0);//Vertex:頂點
glColor3f(0,1,0);
glVertex3f(1,1,0);
glColor3f(0,0,1);
glVertex3f(-1,1,0);
glEnd();






沒有留言:
張貼留言