Dusk Jockeys
03-07-2012, 11:44 PM
I am not sure whether this is standard perspective behaviour. See the png image here and also attached:
http://www.mediafire.com/?7sofo9qq763wfh5
http://www.mediafire.com/?7sofo9qq763wfh5
I have a fairly short and wide viewport area. I am using:
GLU.gluPerspective(gl,25, (float) width / (float) height, 0.1f,100.0f);
to set up my perspective.
I am then drawing three cubes, one far left, one in the centre and one far right, their placement controlled by gl.glTranslatef. The one in the centre appears correct, but those on the left and right dont look correct at all, the perspective seems very wrong, like a fisheye lens or a very widescreen camera shot.
On the left cube, why is the edge on the left longer than the edge on the right? And vice versa on the cube on the right?
I note that the distortion is proportional to the horizontal distance from the centre of the viewport, as I move the cubes nearer the centre, they look much more natural.
Is this normal behaviour on such a perspective projection, or have I done something wrong? Is there any way round it?
Unfortunately I cannot have 3 seperate viewports in my app, I must display all three cubes on a single window.
Thanks for any advice..
http://www.mediafire.com/?7sofo9qq763wfh5
http://www.mediafire.com/?7sofo9qq763wfh5
I have a fairly short and wide viewport area. I am using:
GLU.gluPerspective(gl,25, (float) width / (float) height, 0.1f,100.0f);
to set up my perspective.
I am then drawing three cubes, one far left, one in the centre and one far right, their placement controlled by gl.glTranslatef. The one in the centre appears correct, but those on the left and right dont look correct at all, the perspective seems very wrong, like a fisheye lens or a very widescreen camera shot.
On the left cube, why is the edge on the left longer than the edge on the right? And vice versa on the cube on the right?
I note that the distortion is proportional to the horizontal distance from the centre of the viewport, as I move the cubes nearer the centre, they look much more natural.
Is this normal behaviour on such a perspective projection, or have I done something wrong? Is there any way round it?
Unfortunately I cannot have 3 seperate viewports in my app, I must display all three cubes on a single window.
Thanks for any advice..