Here is how to call glFrustrumf with the values you would give to gluPerspective:
float fov = 45;
float near = 0.01, far = 10;
float aspect = (float)windowWidth / (float)windowHeight;
// glPerspective(fov, aspect, near, far);
top = tan(toRad(fov)) * near;
bottom = -top;
left = aspect * bottom;
right = aspect * top;
glFrustumf(left, right, bottom, top, near, far);
No comments:
Post a Comment