crownmesh
The geometry the Crown is made of. Every piece is generated here and uploaded as a runtime mesh, so the structure is described by the code that shapes it.
crownmesh
The geometry the Crown is made of. Every piece is generated here and uploaded as a runtime mesh, so the structure is described by the code that shapes it.
| Builder | Shape | Used for |
|---|---|---|
M.shell(opts) | a lofted ring of revolution with a scalloped, twisting radius | the eyewall, the inner veil, the anvil cap |
M.vane(opts) | a swept ribbon that curls around the axis and falls, tapering to a point | the blades that leave the wall |
M.rock(seed, radius, jitter?) | a subdivided octahedron pushed out to a jittered radius, flat-shaded | debris, and the slugs the Crown throws |
M.spire(radius, spikes, spikeLen) | a faceted body with spikes along alternate meridians | the core in the eye |
Each returns a MeshHandle, ready for Model { model = handle }.
Two normal policies are used. shell and vane get accumulated (smooth)
normals, because the eyewall shader's fresnel rim needs a continuous normal to
give the wall volume. rock and spire are un-welded onto per-face normals,
because for a chunk the facets are the read.
Surfaces that are a single sheet — every shell, and the vanes — carry a mirrored copy of their triangles so they read from either side.
Geometry is authored around the Y axis: a mesocyclone turns about the
vertical, so a shell's profile is (radius, y) as a function of v running
from the throat at the bottom to the top of the structure.
M.rock is seeded, so the same seed always shapes the same chunk and a rebuilt
Crown is the Crown that was there before.
Scoped to this part · feeds back into the world's score.