到教材 jsyeh.org/3dcg10
下載 [source][data][win32][glut32.dll] 檔案>Transformation
去做交換Swap,寫下差別
右鍵練習不同旋轉
#include <GL/glut.h>
float rotX;
void display()
{
glClearColor(0,0.5,0.5,0);
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotatef(rotX,0,1,0);
glColor3f(2,2,0);
glutSolidTeapot (0.3);
glPopMatrix();
glutSwapBuffers();
}
void motion (int x,int y)
{
rotX= x;
display();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello 3D");
glutDisplayFunc(display);
glutMotionFunc(motion);
///glutMouseFun(mouse);
glutMainLoop();
}
課堂作業2:


你很棒 如果有圖片更佳更明確
回覆刪除你很棒 如果有圖片更佳更明確
回覆刪除