Add line shadow shader
This commit is contained in:
@@ -46,15 +46,15 @@ diagonalLinesRect pa pb w d ang = zip lhsPoints $ map findDiPoint lhsPoints
|
||||
|
||||
highPipe :: Point2 -> Point2 -> Picture
|
||||
highPipe x y = pictures
|
||||
[setDepth (-0.2) $ thickLine [x,y] 10
|
||||
,setDepth (-0.19) $ color orange $ thickLine [x,y] 10
|
||||
,verticalPipe 5 orange x 0 (-0.2)
|
||||
,verticalPipe 5 orange y 0 (-0.2)
|
||||
,verticalPipe 5 orange (0.5 *.* (x +.+ y)) (-0.1) (-0.2)
|
||||
[setDepth 100 $ thickLine [x,y] 10
|
||||
,setDepth 90 $ color orange $ thickLine [x,y] 10
|
||||
,verticalPipe 5 orange x 0 100
|
||||
,verticalPipe 5 orange y 0 100
|
||||
,verticalPipe 5 orange (0.5 *.* (x +.+ y)) 50 100
|
||||
]
|
||||
|
||||
girderZ :: Float -> Point2 -> Point2 -> Picture
|
||||
girderZ w x y = setDepth (-0.1) $ color red $ pictures $
|
||||
girderZ w x y = setDepth 50 $ color red $ pictures $
|
||||
[ thickLine [xt,yt] 3
|
||||
, thickLine [xb,yb] 3
|
||||
]
|
||||
@@ -70,7 +70,7 @@ girderZ w x y = setDepth (-0.1) $ color red $ pictures $
|
||||
ps' = map (\p -> intersectSegLine' xt yt p (p +.+ dia)) ps
|
||||
ls = catMaybes $ zipWith (fmap . (,)) ps ps'
|
||||
girderV :: Color -> Float -> Point2 -> Point2 -> Picture
|
||||
girderV col w x y = setDepth (-0.1) $ color col $ pictures $
|
||||
girderV col w x y = setDepth 50 $ color col $ pictures $
|
||||
[ thickLine [xt,yt] 3
|
||||
, thickLine [xb,yb] 3
|
||||
]
|
||||
@@ -89,7 +89,7 @@ girderV col w x y = setDepth (-0.1) $ color col $ pictures $
|
||||
bs' = catMaybes $ zipWith (fmap . (,)) as $ f (3*pi/4) as
|
||||
girder :: Color -> Float -> Point2 -> Point2 -> Picture
|
||||
girder col w x y = pictures $
|
||||
setDepth (-0.1) (color col $ pictures $
|
||||
setDepth 50 (color col $ pictures $
|
||||
[ thickLine [xt,yt] 3
|
||||
, thickLine [xb,yb] 3
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ startRoom = do
|
||||
w <- state $ randomR (100,400)
|
||||
h <- state $ randomR (200,400)
|
||||
let fground = sPS (0,0) 0 $ PutForeground $ pictures
|
||||
[ highPipe (0,h/2) (w, h/2)
|
||||
[ highPipe (0,h/3) (w, h/3)
|
||||
, girderV cola 10 (0,3*h/4) (w, 3*h/4)
|
||||
, girder colb 5 (0,5*h/8) (w, 5*h/8)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user