Ticket #21: Case02.hs

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