This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
import Data.IORef | |
display :: IORef GLdouble -> IORef GLdouble -> DisplayCallback | |
display rot1 rot2 = do | |
clear [ColorBuffer, DepthBuffer] | |
r1 <- get rot1 | |
r2 <- get rot2 | |
loadIdentity | |
rotate r1 $ Vector3 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
import Data.IORef | |
display :: IORef GLdouble -> IORef GLdouble -> DisplayCallback | |
display rot1 rot2 = do | |
clear [ColorBuffer, DepthBuffer] | |
r1 <- get rot1 | |
r2 <- get rot2 | |
loadIdentity | |
rotate r1 $ Vector3 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
import Data.IORef | |
display :: IORef GLdouble -> IORef GLdouble -> DisplayCallback | |
display rot1 rot2 = do | |
clear [ColorBuffer, DepthBuffer] | |
r1 <- get rot1 | |
r2 <- get rot2 | |
loadIdentity | |
rotate r1 $ Vector3 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
import Data.IORef | |
cubeVertex :: [Vertex3 GLdouble] | |
cubeVertex = [ Vertex3 0 0 0 | |
, Vertex3 1 0 0 | |
, Vertex3 1 1 0 | |
, Vertex3 0 1 0 | |
, Vertex3 0 0 1 | |
, Vertex3 1 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
import Data.IORef | |
display :: IORef GLdouble -> DisplayCallback | |
display rot = do | |
clear [ColorBuffer] | |
r <- get rot | |
loadIdentity | |
rotate r $ Vector3 0 1 0 | |
color (Color3 0 0 0 :: Color3 GLdouble) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
display :: DisplayCallback | |
display = do | |
clear [ColorBuffer] | |
color (Color3 0 0 0 :: Color3 GLdouble) | |
renderPrimitive Polygon $ mapM_ vertex2d [ | |
Vertex2 (-0.9) (-0.9) | |
, Vertex2 0.9 (-0.9) | |
, Vertex2 0.9 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
display :: DisplayCallback | |
display = do | |
clear [ColorBuffer] | |
color (Color3 0 0 0 :: Color3 GLdouble) | |
renderPrimitive LineLoop $ mapM_ vertex2d [Vertex2 (0.5*cos t) (0.5*sin t) | t <- [0,0.01..2*pi]] | |
flush | |
where | |
vertex2d = vertex :: Vertex2 GLdouble -> IO () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
display :: DisplayCallback | |
display = do | |
clear [ColorBuffer] | |
color (Color3 0 0 0 :: Color3 GLdouble) | |
renderPrimitive LineLoop $ mapM_ vertex2d [ | |
Vertex2 (-0.9) (-0.9) | |
, Vertex2 0.9 (-0.9) | |
, Vertex2 0.9 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
display :: DisplayCallback | |
display = do | |
clear [ColorBuffer] | |
color (Color3 0 0 0 :: Color3 GLdouble) | |
renderPrimitive LineLoop $ mapM_ vertex2d [ | |
Vertex2 0 0 | |
, Vertex2 0.3 0 | |
, Vertex2 0.3 0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.GLUT | |
display :: DisplayCallback | |
display = do | |
clear [ColorBuffer] | |
color (Color3 0 0 0 :: Color3 GLdouble) | |
renderPrimitive Lines $ mapM_ vertex2d [ | |
Vertex2 (-0.9) (-0.9) | |
, Vertex2 0.9 0.9 | |
] |