Sphere get bended when moving on X-Y surface, In perspective projection

Started by
10 comments, last by yinyuanqings 12 years, 4 months ago
The difference is that when you call glFrustum, you're not doing any kind of calculation to choose your FOV -- you're just plugging in magic numbers and taking the FOV that they give you.

Internally, gluPerspective simply calls glFrustum:void gluPerspective(float fovy, float aspect, float zNear, float zFar)
{
float ymax = zNear * tan(fovy * 2 * 3.14159f / 180.0f);//degrees to radians
float ymin = -ymax;
float xmin = ymin * aspect;
float xmax = ymax * aspect;
glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
}


If you want to construct your own perspective matrix, you can do so (using wikipedia/wolfram/etc to find the math) and give it to GL via glLoadMatrix.
Advertisement

What is the value of 'basicUnit'? It simply looks like you're using a very wide FOV (wide-angle lens).


You're right, I tried reduce the FOV and now I can get a nearly perfect sphere at corner.. Thanks guy

This topic is closed to new replies.

Advertisement