Module
Hylograph.Isometric.Painter
- Package
- purescript-hylograph-isometric
- Repository
- afcondon/purescript-hylograph-isometric
The painter's order: what to draw first so that nearer things overpaint farther ones.
Marks are compared by their footprints on the floor. For things standing on one floor (prisms of any heights, discs, spikes), one can hide another only if a line running horizontally towards the camera crosses both, and then whichever that line meets first is behind. That relation is acyclic for disjoint convex footprints, so a topological sort of it is a correct order, from any azimuth: not only the four isometric viewpoints. A plain sort by distance is not, as soon as footprints differ in size.
Footprints that overlap can make a cycle; one is then broken at the farthest mark left, so the order is always total.