PDA

View Full Version : Fisheye lens?



degdeg
12-18-2002, 03:36 AM
Hi,
is there anything like the glfrustum/gluPerspective to produce a fisheye lens which is able to see all 360?
Thanks.
Greetings

Mazy
12-18-2002, 07:45 AM
Nope not there, but i guess you could write a vertex program that helps you.

V-man
12-18-2002, 12:09 PM
gluPerspective(359, aspect, near, far)?

Adrian
12-19-2002, 01:30 AM
A vertex program won't work very well if your polygons are large though will it? I need to be able to do fisheye to. At the moment I render five views instead. In theory it would be quicker to render a single fisheye using a vertex program but it won't be if I have to split my wall polygons up.

V-man, gluperspective doesn't work above 179 degrees. It also looks pretty bad above 150.

I think the only way to get good results (unless you have a very high geometry scene) is to render six views and do some processing on the pixels, like this guy has done. http://wouter.fov120.com/gfxengine/fisheyequake/index.html

ToolTech
12-19-2002, 01:40 AM
render normal to a texture and then you use this texture on a warped geometry !

Adrian
12-19-2002, 01:53 AM
Originally posted by ToolTech:
render normal to a texture

render with 90 degree fov? how am I going to see what's behind me? http://www.opengl.org/discussion_boards/ubb/smile.gif

Without using a vertex program I can't see any way of avoiding rendering more than once.

ToolTech
12-19-2002, 01:57 AM
Sorry. I ment render several normal views..

Tom Nuydens
12-19-2002, 07:45 AM
Matrox has a whitepaper on their developer site about "spherical curvilinear projections". It won't give you 360, but it helps reduce the god-awful distortions you get when using extremely large field-of-views (up to 180). They also have a demo of this that runs on all DX8 cards.

-- Tom

mogumbo
12-19-2002, 01:35 PM
Here's a little spheremap building demo (VC++ project). http://www.reallyslick.com/src/Reflect.zip

I've used this code to build spheremaps for some of my apps. If you're interested, I think I have a more refined version at home that I could dig up.

degdeg
12-19-2002, 02:06 PM
Thanks for all the hints.
I think, I will try to render six views and do some processing on the pixels, like the Quake-guy.

Kilam Malik
12-19-2002, 10:42 PM
It should be possible to get 180 if you render 6 textures to a cube map and put it on a screen-size, hollow inside of a sphere. Then the edges are rounded without segmenting them.

Maybe 360 are possible if you compress the 6 textures on only 5 sides of the cube, leaving the 6th blank and doing the same thing with the sphere.

Kilam.

iNsaNEiVaN
12-21-2002, 10:01 PM
You guys are making this way too complicated. V-man has the right idea with the gluPerspective, his values might not be right though.

Adrian
12-22-2002, 03:54 AM
Originally posted by iNsaNEiVaN:
You guys are making this way too complicated. V-man has the right idea with the gluPerspective, his values might not be right though.

Like I said gluPerspective gives poor results at high FOV and gives you a blank screen above 179. This page shows the difference between flat projection (gluPerspective) and spherical projection. http://wouter.fov120.com/gfxengine/fisheyequake/compare.html

zed
12-22-2002, 07:06 AM
http://astronomy.swin.edu.au/~pbourke/projection/