Attached is the code that I use to setup the projection matrix.
main = do
(progname, _) ← getArgsAndInitialize
--initialContextVersion 3 0
createWindow "Ben Christy Assignment 2"
windowSize $= Size 800 600
matrixMode $= Projection
loadIdentity
depthFunc $= Just Less
viewport $= (Position 0 0, Size 800 600)
perspective 60 1.333 1 1200
--tableModel ← initModelVBO (vertexTupleListToVertexList table)
changesRef ← newIORef Map.empty
sceneRef ← newIORef buildSSG
balloonState ← newIORef There
balloonZTarget ← newIORef 4
balloonZStart ← newIORef 0
balloonStep ← newIORef 0
balloonNumSteps ← newIORef 0
reshapeCallback $= Just reshape
displayCallback $= (displayScene sceneRef changesRef )
--addTimerCallback 10 (animate sceneRef changesRef balloonState balloonZTarget balloonZStart balloonStep balloonNumSteps)
keyboardMouseCallback $= Just (handleInput sceneRef changesRef)
mainLoop
reshape (Size w h) = do
print "resize"
matrixMode $= Projection
loadIdentity
depthFunc $= Just Less
viewport $= (Position 0 0, Size w h)
perspective 60 1.333 0.01 1200
matrixMode $= Modelview 1
loadIdentity
postRedisplay Nothing