Week15-1 攝影機
至https://jsyeh.org/3dcg10/下載Examples:[source]、[data]、[win32],並解壓縮
把data加入windows資料夾,再開啟Projection.exe
把data加入windows資料夾,再開啟Projection.exe
更改135~142,151行程式碼如以下
...
float eyeX=0,eyeY=0;
void motion(int x, int y){
eyeX=3*(x-320)/320.0;week15-1 gluPerspective
eyeY=3*(240-y)/240.0;
glLoadIdentity();
gluLookAt(eyeX,eyeY,3,0,0,-6,0,1,0);
glutPostRedisplay(); ///重畫畫面
}
...
glutMotionFunc(motoin);
...
沒有留言:
張貼留言