没有Glu,我该如何与GluPerspective一样?谢谢

例如:gluPerspective(45.0,(float)w /(float)h,1.0,200.0);

最佳答案

void gluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar )
{
    GLdouble xmin, xmax, ymin, ymax;

    ymax = zNear * tan( fovy * M_PI / 360.0 );
    ymin = -ymax;
    xmin = ymin * aspect;
    xmax = ymax * aspect;

    glFrustum( xmin, xmax, ymin, ymax, zNear, zFar );
}

关于c++ - GLUPerspective的原始OpenGL等价物?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3058552/

10-11 16:04