Hi there,
I am having problems getting my projection just right. I want a orthographic projection of my world such that it looks just like SimCity 2000, Transport tycoon etc. E.g. I want tiles with a 2:1 ratio on screen.
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-400, +400, -300, +300, -1000, +1000);
glRotated(-orthoAngle, 1, 0, 0);
glRotated(45, 0, 0, 1);
With the angle I calculated having to be arctangens of 2.
double PI = std::acos(-1);
double orthoAngle = (std::atan(2) * 180) / PI;
Now this is nearly correct, it the orthoAngle variable is set to about 63.43 degrees. Now this gives some artifacts in my world, such as the tiles that are being drawn are not exactly in the 2:1 ratio. An orthoAngle of about ~62.09 seems to do a better job. Obviously I don't want to have to fill in a random constant like that and I would like to get the theory right. Could anyone help me out??
The result of the original projection is as follows:
CLICK!
Kind regards,
Mark