Does anyone know how a custom projection matrix would be made…such as for stereographic projection? Stereographic projection converts all objects from 3D to a sphere where it is then projected onto a 2D plane preserving only angles; neither are nor distance. On Wikipedia: http://en.wikipedia.org/wiki/Stereographic_projection
I have no experience in making new matrix types so I really will need some code (preferably in C but any other OpenGL supported language would do) to undertand.
I do think the OP actually want a spherical projection, not a 3D stereo asymmetrical frustum.
Unfortunately, as this projection is non-linear, you have to use highly tesselated geometry, otherwise the straight lines from vertex to vertex will look wrong.
To me the best would be to render 6 standard views with 90° fov, around the camera center, then use a shader to inverse transform each screen pixel to go fetch the correct texel from cube view.
Something like this (it was software rendering but now doable with OpenGL alone) : http://strlen.com/gfxengine/fisheyequake/index.html
Stellarium has some nice projections, including a true stereographic one : http://www.stellarium.org/img/screenshots/0.10-planets.jpg
O’key, seems, you’re right, ZBuffeR.
Caglow, forget my unuseful advice
Actually, when I hear “stereographic projection”, I’m always thinking about 2 deflected frustumus for anaglyphic stereo, so my mistake can be explained o)
What I want is actually the projection you see in stellarium…the default one. I’m not quite sure if I’m explaining things correctly but that’s what I want. http://stellarium.org
EDIT: I noticed that it’s been mentioned but how does stellarium do it? Their code has been integrated with everything else making it hard to find everything I need.
I don’t know, how exactly Stellarium guys are doing that, but if I were doing it, I would render 6 cube-side views to cubemap texture, and then I would use fragment shader for full-screen quad to obtain remmapped spherical direction (according to fish-eye projection formulaes) and fetch a texel from cubemap by this direction. That’s waht ZbuffeR has actually proposed.
I skimmed through Stellarium code, it seems to be done by transforming the vertices “by hand”, so it looks to use the low tech solution I mentioned, the one that needs high tesselation.
In Stellarium it is not really a problem for stars (dots), and the only other geometry is the ground and orbit lines.