Created
April 12, 2011 17:05
-
-
Save ikedaisuke/915931 to your computer and use it in GitHub Desktop.
Rotate a square in Gloss
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
-- An example of Gloss | |
-- http://www.f13g.com/%A5%D7%A5%ED%A5%B0%A5%E9%A5%DF%A5%F3%A5%B0/Haskell/GLUT/#content_1_2 | |
module Main where | |
import Graphics.Gloss | |
main :: IO () | |
main | |
= animateInWindow | |
"GuruGuru" | |
(200, 200) | |
(10,10) | |
black | |
frame | |
frame :: Float -> Picture | |
frame time | |
= Color white | |
$ Scale 120 120 | |
$ Rotate (time * 12 * pi) | |
$ Polygon [ ( 0.10, 0.10) | |
, (-0.10, 0.10) | |
, (-0.10, -0.10) | |
, ( 0.10, -0.10)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment