2023年3月15日 星期三

呱! - Week05 - 特定軸轉動(T-R-T)🦆

Week05





step01

下載

https://jsyeh.org/3dcg10/

data > data.zip

win32 > windows.zip

glut32.dll > 按保留

解壓縮

windows.zip > 下載 > windows\Transformation.exe

data.zip > windows\data(解壓後的data拉去windows資料夾下)



點選Transformation.exe



移動到右邊的轉動長胖的藍色車子





兩行對調


整個轉動移動到右邊長胖的藍車



補充:利用Github、Leetcode累積作品量



-1





step02-1_用CodeBlocks 17.12 新增GLUT專案


開新GLUT專案 > week05-1_TRT_rotate_translate
從Github複製week04-1_rotate,貼到專案


TRT_rotate_translate





-2




step03-1_使用opengl_TRT


試著畫出可移動手臂





開啟老師傳送過來的檔案






執行繪畫
(切換到英打,按下空格鍵即可成功執行)


myDrawObject(0);///身體
glPushMatrix();
    glTranslatef(+0.18,+0.28,0);//(3)最後把會移動的手臂,掛在肩膀上
    glRotatef(angle,0,0,1);        //(2)整個世界都對Z軸轉
    glTranslatef(-0.18,-0.28,0); //(1)把旋轉中心放正中間
    myDrawObject(1);///要轉動的手臂
glPopMatrix();



-3


step03-2_*考試題目*


glPushMatrix();
    glTranslatef(-0.5,-0.9,0);///(2)新座標
    glRotatef(-45,0,0,1);     
    glTranslatef(-0.8,-0.9,0);///(1)把轉動點改為中心點
    drawHand();
glPopMatrix();


-4




step03-3_Cube





-5






安裝Git GitBash
-cd desktop
-git clone https://github.com/Owoyayou/2023graphicsa
-cd 2023graphicsa
-start .
  (打開2023graphicsa資料夾,把今日程式碼檔案放進來)
-git add .
-git status
(開啟檔案總管)
-git config --global user.email ______________
-git config --global user.name Owoyayou
-git commit -m "week05"
-git push



沒有留言:

張貼留言