Hylograph.Isometric.Prism
- Package
- purescript-hylograph-isometric
- Repository
- afcondon/purescript-hylograph-isometric
Prisms: an outline extruded upwards, and the faces of it a camera sees.
A box is a rectangle extruded, a cylinder a circle. Faces come in two
forms: faces gives every face of a polygon prism in the world, wound
anticlockwise about its outward normal; visibleFaces gives what a
camera draws of any prism, projected, with a flat shading for each.
#prismOutline Source
prismOutline :: Prism -> Outline#visibleFaces Source
visibleFaces :: Camera -> Prism -> Array DrawnFaceWhat the camera sees of a prism: the faces turned towards it, projected. A prism is convex, so its visible faces never overlap one another; they come sides first and top last, so the top's outline is drawn over the edges it shares with them.
A flat face is kept when its projected outline winds the way a face seen from outside does, which is the same as its normal facing the camera. A cylinder's curved side is drawn as one face: the half of it towards the camera.