SHARE
TWEET

Display.hs for OpenGL tutorial

a guest Aug 16th, 2012 16 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Display (display) where
  2.  
  3. import Graphics.Rendering.OpenGL
  4. import Graphics.UI.GLUT
  5.  
  6. import Cube
  7. import Points
  8.  
  9. display :: IO()
  10. display = do
  11.         clear [ColorBuffer]
  12.         scale 0.7 0.7 (0.7::GLfloat)
  13.         mapM_ (\(x,y,z) -> preservingMatrix $ do
  14.                 color $ Color3 ((x+1.0)/2.0) ((y+1.0)/2.0) ((z+1.0)/2.0)
  15.                 translate $ Vector3 x y z
  16.                 cube (0.1::GLfloat)
  17.                 ) points 7
  18.         flush
RAW Paste Data
Top