WEEK04
1.
http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/
網址下載 Windows32 /Data/ glut32.dll
解壓縮 Windows
打開 Data 拉進Windows資料夾
glut也直接拉進Windows資料夾
2.
https://www.transmissionzero.co.uk/software/freeglut-devel/
網址下載freeglut
3.
Codeblocks開啟open glut方案
刪除舊的程式碼改成
float x=0,y=0; ///現在重點在滑鼠
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glPushMatrix(); ///備份矩陣(保護)
glTranslatef((x-150)/150.0,-(y-150)/150.0,0); ///移動
glutSolidTeapot(0.3);
glPopMatrix();///還原矩陣(恢復)
glutSwapBuffers();
}
void motion(int nowx,int nowy)
{
x=nowx;y=nowy;
display();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("week04");
glutDisplayFunc(display);
glutMotionFunc(motion);///現在重點在滑鼠
glutMainLoop();
}







沒有留言:
張貼留言