1.從上課軟體下載freeglut
2.將壓縮檔解壓到桌面
3.點開freeglut後復製其連結
4.點開lib後將freeglut.a復製
5.改名為libglut32.a (124KB)
6.到codeblock開新的專案 file > project,(當名為week03_mouse)
7.將上週的10行程式貼到這次的(
#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_mouse");
glutDisplayFunc(display);
glutMainLoop();
}
)
8.改名week03 mouse , 加glutmousefunc(mouse);
13.到老師的網站(https://jsyeh.org/3dcg10/)
14.下載data,win32
15.解壓縮data.zip,window.zip
16.將data資料夾丟到window裡面(解壓後的檔案)
17.點開Transformation.exe
18.到codeblock開新的專案 file > project,(當名為week03_mouse_glTranslanf)
19.利用剛剛的mouse程式碼加上偷幾行原本的程式碼(46,49,54),再加上一行程式碼
對y軸轉,簡單比個讚
對x軸轉把拇指向右
對-y軸轉,就是比個倒讚
對z軸把拇指指向自己
22.到codeblock開新的專案 file > project,(當名為week03_mouse_glRotatef)
這是盜版,大家別相信
回覆刪除