到Blog老師示範有網址>複製並前往

將[data] [win32] glut32.dll >按右鍵下載

開啟我的電腦>下載>window按右鍵

將另外兩個檔案放進解壓縮後的window

就可開啟檔案練習 點 線 面 顏色!

課堂作業2:
跟第一週作業一樣開啟GLUT

複製第一週作業的茶壺10行程式碼

新增「glColor3f(r,g,b)」(可自行設定顏色)

改背景顏色,完成!

程式碼如下:
#include <GL/glut.h>
void display()
{
glutSolidTeapot(0.3);
glutSwapBuffers();
glColor3f(1,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(1,1,1,0);
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言