2.開啟freeglut
3.const GLfloat light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
const GLfloat light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat light_position[] = { 2.0f, 5.0f, 5.0f, 0.0f };
const GLfloat mat_ambient[] = { 0.7f, 0.7f, 0.7f, 1.0f };
const GLfloat mat_diffuse[] = { 0.8f, 0.8f, 0.8f, 1.0f };
const GLfloat mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
const GLfloat high_shininess[] = { 100.0f };
=>紅色茶壺(可以調整攝影機)
4.試著修改center,會發現中心點改變了
5.開啟Perspective,執行後會是一個旋轉的茶壺(可以試著改視角)
6.main_pushTRTpop.cpp執行後會有上下擺動的茶壺群
glPushMatrix();
glTranslatef(xxx);掛上去
glRotatef(xxx);旋轉
glTranslatef(xxx);定旋轉中心
畫手臂{重複
glPopMatrix();






沒有留言:
張貼留言