Log inGet started
World

First Light: Goura

Branchmain
Branchesmain
Commite917faa950

README.md

gouramesh

Tawpy's geometry, written as numbers. Every part of the Victoria crowned pigeon is generated here from the four builders in game.hero.pgmesh — a lens for the volumes, a lathe for the bill and the eyes, a ribbon for the crest plumes and the tail feathers — and handed back as flat-array Geom tables, the shape renderer.mesh.create takes.

Nothing here touches engine state, spawns anything or draws anything. It is arithmetic. game.hero.gouraart uploads what it returns, paints the plumage against these UVs and hangs the parts on an entity.

The bird

She is a heavy ground bird: a deep body on short thick legs, a small head carried close on a short neck, a long fanned tail, and the lace crest standing over all of it. Feet at y = 0, facing her local -Z (the lane runs that way), symmetric about X. She stands 1.00 to the crest tips and measures 1.38 from bill tip to tail tip.

Exports

  • M.goura() -> { [string]: Geom } — every mesh she is made of: body, breast, neck, head, bill, eye, pupil, plume, wingR, wingL, rectrix, shank, foot. Costs a few milliseconds; gouraart calls it once a session.
  • M.ANCHOR — where each pivot hangs in its parent. gouraart builds the entity tree from it, so the geometry and the joints cannot drift apart.
  • M.CROWN_HEIGHT — the height the anchors are written at, so a rig at another size scales by crownHeight / CROWN_HEIGHT.
  • M.CREST (count, spread, rake) with M.plumeAngles(i, count, flare) and M.plumeLength(i, count) — where each crest plume sits in the fan and how long it is. flare opens and closes the whole fan, which is what the boom and the startle drive.
  • M.TAIL (count, spread, droop) with M.tailAngles(i, count, fan) and M.tailLength(i, count) — the same for the rectrices. fan opens the tail.
  • M.bodyHalfZ(y), M.bodyHalfX(y), M.bodyOffsetZ(y) — the body's ellipse at a height, which is how the breast patch finds the surface it sits a hair outside of.

Notes

  • The two wings are separate geometry rather than one mesh used twice: each draws its tip in toward her flank as the body tapers, so a folded wing finishes inside her silhouette instead of standing off it as a flap. Mirroring one mesh with a negative scale would turn its triangles inside out.
  • The lathe's open arc faces +Z, so the breast patch is built there and the rig yaws it half a turn onto her front.
  • The bill is built up its own +Y and stood forward by a quarter turn on the rig, so a positive zoff on a bill ring is the culmen bending DOWN.
  • A swept part is roughened for feather texture, but never on the rows where its cross-section has closed to a point: those vertices sit on top of one another and displacing them turns the triangles between them inside out.