1. 主題: T-R-T 對特定軸轉動
2. 複習: 移動-旋轉 vs 旋轉-移動, 縮放
3. 主題: 補講解矩陣Matrix 1 2 3
4. 實作: 機器手臂的轉動
https://youtu.be/uXGE0vuuaDo
https://youtu.be/Z2eCmhBgsyI
https://youtu.be/uXGE0vuuaDo
https://youtu.be/Z2eCmhBgsyI
----------------------------------------------
glColor3f(0, 1, 0); ///Green
glPushMatrix();
glTranslatef(0.8, 0, 0); ///最後是綠色移動
glRotatef(angle, 0, 0, 1); ///改對z軸
glutSolidTeapot(0.3);
glPopMatrix();
glColor3f(1, 0, 0); ///Red
glPushMatrix();
glRotatef(angle, 0, 0, 1); ///改對z軸轉, 最後是紅色轉動
glTranslatef(0.8, 0, 0);
glutSolidTeapot(0.3);
glPopMatrix();
下周考題 T-R-T特定軸轉
glTranslale(0.27, 0.39) 移動整隻手臂
glRotate(angle, 0, 0, 1) 轉動角度(右手定律:向右為負, 向左為正)
glTranslate(-0.23, -0.23) 移動中心點(白點)
glColor3f(0, 1, 0); ///Green body
glPushMatrix();
glutSolidCube(0.5);
glPushMatrix();
glTranslatef(0.25, 0.25, 0); /// 移動位置
glRotatef(angle, 0, 0, 1); ///轉動
glTranslatef(0.25, 0.25, 0); ///移動中心點
glColor3f(1, 0, 0);
glutSolidCube(0.5);
glPopMatrix();
glPopMatrix();



沒有留言:
張貼留言