Ticket #21: Case01.hs

File Case01.hs, 0.6 kB (added by ksf, 5 years ago)
Line 
1module Main where 
2
3import FRP.Reactive
4import FRP.Reactive.GLUT.Adapter
5import FRP.Reactive.FieldTrip.Adapter
6import Graphics.FieldTrip
7import Data.Monoid
8import Control.Applicative
9
10timeAtFramePass :: UI -> Event TimeT
11timeAtFramePass = snapshot_ time . framePass
12
13timeString :: UI -> Behaviour String
14timeString = stepper "" . ((fmap.fmap) show timeAtFramePass)
15
16timeText :: Anim3 -- UI -> Behaviour Geometry3
17timeText = (fmap.fmap) (flatG . utext) timeString
18
19uscale ::  Float -> Geometry3 -> Geometry3
20uscale s = (uscale3 s *%)
21
22timeDisplay :: Anim3
23timeDisplay = (fmap.fmap) (uscale 0.2) timeText
24
25main = anim3 $ timeDisplay