2018/03/19
複習上周:mouse,移動
今日主題:移動,旋轉,縮放
範例:Transformation.exe
期中考題目
1.先到jsyeh.org/3dcg10下載glut32.dll,windows.zip,data.zip三個檔案
2.將windows.zip解壓縮之後把glut32.dll和data.zip放到windows資料夾內
開啟transformation.exe檔案
3.調整角度與認識角度(安培右手定理)
***glRotatef(角度,X軸,Y軸,Z軸)
4.期中考考題
glPushMatrix();//備份矩陣
glTranslaref(x,y,z);//移動
glRotatef(angle,x,y,z)//角度
glScalef(x,y,z);//放大縮小
glBegin(GL_POLYGON);
glColor3f(x,y,z);顏色
glVertex3f(x,y,z);頂點
glEnd();//結束畫Begin()
glPopMartix();//還原矩陣
沒有留言:
張貼留言