I'm trying to draw the celestial sphere in OpenGL, from the inside (from the perspective of the solar system). I want to be able to turn the camera around and see the stars in the milky way.
I'm using OpenGL 3 (and Glut) because that's well supported in Haskell. I'm using textures, because that seems simple enough for my purposes. I'm not trying to make it incredibly accurate, or spend too much time on it. I'm using this image as texture: https://www.eso.org/public/images/eso0932a/
My gist of my code is as follows:
render tex i = do
-- Clear background
...
-- paint sphere
GL.matrixMode $= GL.Modelview 0
GL.loadIdentity
GL.texture GL.Texture2D $= GL.Enabled
GL.textureBinding Texture2D $= Just tex
GL.rotate (90+i) (Vector3 0.0 1.0 (0.0 :: GLfloat)) -- turn image around
-- just because
GL.rotate 90 (Vector3 1.0 0.0 (0.0 :: GLfloat)) -- turn image sideways
-- to align with ecliptic
GL.preservingMatrix $
Quad.renderQuadric myStyle sphere
GLUT.swapBuffers
GL.texture GL.Texture2D $= GL.Disabled
render tex (i+0.04)
Something is drawn if the sphere is small (e.g., 1 unit, whatever that means): it looks like it's just another celestial body. But if I start making it bigger, so that the viewer is inside it, then a hole opens in the middle and it eventually disappears. All I see is the background.
I'd like to see the inside of the sphere.
What am I doing wrong?