*視角
gluLookAt(eyex,eyey,eyez,objx,objy,objz,upx,upy,upz);
參數:觀看者x,觀看者y,觀看者z,物體x,物體y,物體z,角度向量x,角度向量y角度向量z
*運鏡
if(key==' ') {eyex-=0.02,eyey-=0.02;}
按空白鍵改變視角
*旋轉運鏡
void timerRotateShow(int t)
{
glutTimerFunc(30,timerRotateShow,t+1);
eyex=cos(t/100.0*3.1415);
eyez=sin(t/100.0*3.1415);
eyey-=0.005;
glutPostRedisplay();
}
*背景顏色
if(t%10==0)glClearColor((rand()%255)/255.0,(rand()%255)/255.0,(rand()%255)/255.0,(rand()%255)/255.0);
*放大縮小
沒有留言:
張貼留言