Want more features on Pastebin? Sign Up, it's FREE!
Guest

Display.hs for OpenGL tutorial

By: a guest on Aug 16th, 2012  |  syntax: Haskell  |  size: 0.38 KB  |  views: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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
clone this paste RAW Paste Data