Well the thing is, that I wan’t to picture mazes with a different width and height. I’m drawing them in units and my question is, how can I get the plane viewable dimensions in units that I would know how deep inside the screen I would have to draw my maze in order it would be fully seeable. For perspective view I use “::gluPerspective(45.0f, (GLfloat)width / (GLfloat)height, 1.0f, 100.0f);”

For example how I get the near plane dimensions(width and height) in OpenGL units or the far plane or any plane between those planes. If I want to picture something entirely seeable I need to know the plane dimensions in OpenGL units or is there another way?
A bit of trigonometry will tell you that:
h_near = 2*near*tan(fovy/2)and the same for far:h_far = 2*far*tan(fovy/2)Then, the ratio will give you the width.
For the “proof”, just consider the right-angled triangle formed by the line of view, the vertical of the plane of rendering and back. The length of the line of view is
nearorfar(depending), the angle at the eye position isfovy/2(i.e. half the view angle) and the vertical on the plane ish_near/2orh_far/2, as we only get half-way to the plane. Then, the tangent of the angle on a right-angled triangle is equal to the far-side divided by the near-side …