Make light position uniform 3d
This commit is contained in:
+10
-10
@@ -9,9 +9,9 @@ import Picture
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
|
||||
lightAt :: Point2 -> Int -> LightSource
|
||||
lightAt p i =
|
||||
lightAt (x,y) i =
|
||||
LS {_lsID = i
|
||||
,_lsPos = p
|
||||
,_lsPos = (x,y,0)
|
||||
,_lsDir = 0
|
||||
,_lsRad = 600
|
||||
,_lsIntensity = 0.75
|
||||
@@ -23,14 +23,14 @@ basicLS = PutLS ls dec
|
||||
dec = onLayer PtLayer $ color white $ circleSolid 8
|
||||
|
||||
tLightFade :: Int -> Float -> (Int -> Float) -> Point2 -> TempLightSource
|
||||
tLightFade 0 rmax intensityF p = TLS
|
||||
{ _tlsPos = p
|
||||
tLightFade 0 rmax intensityF (x,y) = TLS
|
||||
{ _tlsPos = (x,y,0)
|
||||
, _tlsRad = rmax
|
||||
, _tlsIntensity = intensityF 0
|
||||
, _tlsUpdate = \w _ -> (w, Nothing)
|
||||
}
|
||||
tLightFade i rmax intensityF p = TLS
|
||||
{ _tlsPos = p
|
||||
tLightFade i rmax intensityF p@(x,y) = TLS
|
||||
{ _tlsPos = (x,y,0)
|
||||
, _tlsRad = rmax
|
||||
, _tlsIntensity = intensityF i
|
||||
, _tlsUpdate = \w _ -> (w, Just $ tLightFade (i-1) rmax intensityF p)
|
||||
@@ -42,14 +42,14 @@ tLightRad
|
||||
-> Float -- ^ minimal radius (unused)
|
||||
-> Point2
|
||||
-> TempLightSource
|
||||
tLightRad 0 rmax _ p = TLS
|
||||
{ _tlsPos = p
|
||||
tLightRad 0 rmax _ (x,y) = TLS
|
||||
{ _tlsPos = (x,y,0)
|
||||
, _tlsRad = rmax
|
||||
, _tlsIntensity = 0.5
|
||||
, _tlsUpdate = \w _ -> (w, Nothing)
|
||||
}
|
||||
tLightRad i rmax rmin p = TLS
|
||||
{ _tlsPos = p
|
||||
tLightRad i rmax rmin p@(x,y) = TLS
|
||||
{ _tlsPos = (x,y,0)
|
||||
, _tlsRad = rmax
|
||||
, _tlsIntensity = 0.5
|
||||
, _tlsUpdate = \w _ -> (w, Just $ tLightRad (i-1) rmax rmin p)
|
||||
|
||||
Reference in New Issue
Block a user