親手打造的第一個茶壺圖學程式
step1:打開一個glut專案檔
step2:刪減程式碼到剩下這樣
step3:新增一個茶壺的程式碼
glutSolidTeapot(0.3)
step4:為茶壺加上顏色(打在茶壺的程式碼之前)
glColor3f(R,G,B)
[3f代表三個顏色的浮點數]
[RGB範圍從1~0]
step5:執行
完成!!!!!!
親手打造的第一個3D圖學程式
step1:打開一個glut專案檔
step2:刪減程式碼到剩下這樣
step3:為接下來的圖形加上顏色
glColor3f(R,G,B)
[3f代表三個顏色的浮點數]
[RGB範圍從1~0]
step4:打上一個多邊形
glBegin(GL_POLYGON);//新增一個多邊形
glVertex3f(1,1,0);//輸入第一個點的座標
glVertex3f(-1,1,0);//第二個
glVertex3f(0,-1,0);//可以加很多很多個
glEnd();//多邊形結束
step5:執行
完成!!!!
沒有留言:
張貼留言