module Graphics.Mars.Example where
import Prelude(IO, (.), ($), writeFile)
import Graphics.Gloss (black)
import Data.Array.Unboxed (elems)
import Graphics.Mars.Paint
import Graphics.Mars.Graph
import Graphics.Mars.Display2D
import Graphics.Mars.Ply
example2D :: IO()
example2D = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
displayWindow (width, height) black "Mars"
(toImage a (lightnessInt hue (minMax (elems a))))
where (width, height) = (300, 300)
radius = 30
walkfactor = 30
seed = 9484
hue = 272
iterations = 200
scalefactor = 1
startingpoint = (0, 0)
examplePly :: IO ()
examplePly = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
writeFile "out.ply" $ (toPly . surface) a
where (width, height) = (400, 400)
radius = 10
walkfactor = 10
seed = 4748830300
iterations = 400
scalefactor = 1
startingpoint = (0, 0)
examplePly2 :: IO ()
examplePly2 = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
writeFile "out2.ply" $ (toPly . surface) a
where (width, height) = (400, 400)
radius = 10
walkfactor = 10
seed = 84934
iterations = 400
scalefactor = 1
startingpoint = (0, 0)
examplePly3 :: IO ()
examplePly3 = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
writeFile "out3.ply" $ (toPly . surface) a
where (width, height) = (400, 400)
radius = 10
walkfactor = 10
seed = 49409484
iterations = 2000
scalefactor = 1
startingpoint = (0, 0)
examplePly4 :: IO ()
examplePly4 = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
writeFile "out4.ply" $ (toPly . surface) a
where (width, height) = (600, 600)
radius = 10
walkfactor = 20
seed = 1829384
iterations = 4000
scalefactor = 1
startingpoint = (0, 0)
examplePly5 :: IO ()
examplePly5 = do a <- graph height width radius walkfactor
seed iterations scalefactor startingpoint
writeFile "out5.ply" $ (toPly . surface) a
where (width, height) = (1000, 1000)
radius = 15
walkfactor = 15
seed = 74830949937
iterations = 40000
scalefactor = 0.5
startingpoint = ((250), 250)