2017年10月5日 星期四

筆記 Week04

(1) 主題: 移動、旋轉、縮放
(2) 實作: Translate、Rotate、Scale
(3) 觀念: 矩陣 Matrix、Push、Pop
(4) 作業: 加入移動、旋轉等

*更改display()函式,+三角錐



















glPushMatrix()
        glTranslated(0,1.2,-6); // 物件位置
        glRotated(60,1,0,0); // 旋轉
        glRotated(a,0,0,1);
        glColor3f(1,1,0); // Yellow
            glutSolidTetrahedron(); //三小錐
        glColor3f(1,0,0); // Red
    glPopMatrix();

*glScalef() 縮放
















glScalef(2,2,2); // x y z 各放大兩倍

沒有留言:

張貼留言