Hylograph.Isometric
- Package
- purescript-hylograph-isometric
- Repository
- afcondon/purescript-hylograph-isometric
hylograph-isometric: an orthographic camera for Hylograph.
An isometric view is a projection, not a layout: a 2D layout is put on a
plane in the world, given heights, and projected by a camera with two
angles. This module re-exports the pure geometry; the HATS drawing
helpers are in Hylograph.Isometric.HATS.
Re-exports from Hylograph.Isometric.Camera
#Camera Source
newtype Camerascale is screen units per world unit along the line of sight's
perpendicular plane (a true orthographic scale): a unit along an axis is
drawn shorter than scale by the cosine of its angle to that plane.
Constructors
Instances
#viewpointAzimuth Source
viewpointAzimuth :: Viewpoint -> Degrees#towardsCamera Source
towardsCamera :: Camera -> Point3The unit vector from the scene towards the camera.
#screenRight Source
screenRight :: Camera -> PointThe horizontal unit vector that the camera draws pointing right.
#nextViewpoint Source
nextViewpoint :: Viewpoint -> ViewpointA quarter turn of the camera, anticlockwise seen from above (azimuth + 90°).
#isometricUnit Source
isometricUnit :: Number -> CameraThe isometric camera (from the south-east) at the scale that draws a
unit along any axis length screen units long.
#isometricFrom Source
isometricFrom :: Viewpoint -> Camera#floorTowardsCamera Source
floorTowardsCamera :: Camera -> PointThe horizontal direction towards the camera, as a unit vector in the floor.
Re-exports from Hylograph.Isometric.Outline
Re-exports from Hylograph.Isometric.Painter
#paintersOrder Source
paintersOrder :: forall a. Camera -> (a -> Outline) -> Array a -> Array aThe items in an order to draw them in, back to front.
Re-exports from Hylograph.Isometric.Plane
Re-exports from Hylograph.Isometric.Prism
#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.
#prismOutline Source
prismOutline :: Prism -> OutlineRe-exports from Hylograph.Isometric.Spike
#SpikeShape Source
#spikeOutline Source
spikeOutline :: Camera -> Spike -> Array PointThe spike as drawn: a triangle or a rectangle across the line of sight.
#spikeFootprint Source
spikeFootprint :: Spike -> OutlineWhat the painter's order should take a lone spike to cover on the floor.