Game Development Community

How to correct "fisheye" distortion at the screen edges?

by Jason Peterson · in Torque Game Engine · 07/10/2006 (9:32 pm) · 6 replies

Does anyone know how to eliminate the stretching "fisheye" distortion at the screen edge?

I have a virtual cockpit that has multiple guiViewports spanned across three monitors; one with a camera angle of 300 degrees and a FOV of 60 degrees (left window); one with a camera angle of 0 degrees and an FOV of 60 degrees (center window); and one with a camera angle of 60 degrees and a FOV of 60 degrees (right window); .

I would like to stitch the guiViewports together to represent windows in the cockpit. The edges of each guiViewport are distorted so that when the edges are matched up the level geometry does not flow correctly between the viewports. Anyone have a fix, or a thought to point me in the right direction?

Thanks,

Jason

#1
07/10/2006 (11:35 pm)
A linear transform won't necessarily map well to a very wide view angle.

See Fisheye quake for excellent illustration of why this is. :)

I'd dig around a bit in the VR space, they have solutions for this stuff - possibly more elegant than what we might come up with brainstorming here!
#2
07/11/2006 (3:09 am)
@Jason

I've been curious about this as well -- just haven't looked into it yet. (sorry for the pun)

@Ben

Interesting link.
#3
07/11/2006 (7:13 am)
There's a method described for doing this on Bert Freudenberg's blog.
(see the post titled "print-quality screenshots")

Quote:What is needed instead is to construct partial viewing frustums that together exactly recreate the whole frustum.

the code snippets are for OpenGL, but they're in Smalltalk. it should be easy enough to read but let me know if any translation is needed.
#4
07/11/2006 (8:33 am)
.. actually i guess what that does is simulate a single very wide viewport,
which as Ben pointed out doesn't look too hot with extremely wide angles such as 180 degrees.

so please disregard the above, altho it's still interesting.
#5
07/11/2006 (9:45 am)
After looking at this further maybe it is not a fisheye problem. Take a look at this...

www.wizardwire.net/overview.jpg
I have three monitors setup... each with a 60 deg field of view guiViewport at the correct angles to compensate for the gap between the monitors. The picture above does not look right because it was taken from the wrong point of view. Now take a look at this...

www.wizardwire.net/parallel.jpg
This is taken from the players point of view. At the bottom of the screen every thing looks the way it should the beam that spans between the monitors is straight and parallel. Now take a look at this...

www.wizardwire.net/problem.jpg
Here's the problem. At the top of the viewports things do not line up. This may not be "fisheye" but something else? Any ideas or suggestions.

Thanks for all the feed back.

Jason
#6
07/11/2006 (2:56 pm)
You might want to try adding a little GUI with some sliders so you can play with different view parameters. It might help you visualize what's going on. Another thing might be adding a way to dump out and visualize the view frustrums - they should be exactly touching on one side.