2020年6月3日 星期三

week15

week15

             fovy aspect zNear zFar
fov: field of vide      視野
fovy:Y方向視野
aspect ratio: 長寬的高度
zNear: Z方向,近的面
zFar: Z方向,遠的面

左 ,右,

static void resize(int width, int height)
{
    const float ar = (float) width / (float) height;

    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
   glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0); (改成下面那行)
    gluPerspective(60,1,0.001,1000); 透視投影

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity() ;

}


沒有留言:

張貼留言