Working (but slow) shadow shapes
This commit is contained in:
+18
-1
@@ -1,4 +1,14 @@
|
||||
module Polyhedra
|
||||
( translateXY
|
||||
, rotateXY
|
||||
, polyToEdges
|
||||
, constructEdgesList
|
||||
, boxXYZ
|
||||
, boxABC
|
||||
, boxXYZnobase
|
||||
, polyToGeoRender
|
||||
, polysToPic
|
||||
)
|
||||
where
|
||||
import Geometry
|
||||
--import Geometry.Data
|
||||
@@ -129,7 +139,14 @@ polysToPic :: [Polyhedra] -> Picture
|
||||
polysToPic = pictures . concatMap polyToPics
|
||||
|
||||
polyToEdges :: Polyhedra -> [(Point3,Point3,Point3,Point3)]
|
||||
polyToEdges = constructEdges . map (map fst) . _pyFaces
|
||||
polyToEdges = map denormalEdges . constructEdges . map (map fst) . _pyFaces
|
||||
|
||||
denormalEdges :: (Point3,Point3,Point3,Point3) -> (Point3,Point3,Point3,Point3)
|
||||
denormalEdges (a,b,n,m) = (a,b,a - x, b - y)
|
||||
where
|
||||
x = crossProd (b - a) n
|
||||
y = crossProd (a - b) m
|
||||
|
||||
|
||||
polyToGeoRender :: Polyhedra -> [Point3]
|
||||
polyToGeoRender = concatMap (polyToTris . map fst) . _pyFaces
|
||||
|
||||
Reference in New Issue
Block a user