Log inGet started
World

First Light: Betocsin

Branchmain
Branchesmain
Commit065ea629bf

README.md

Geo

The mesh builders behind the masonry, the bell and the crane. Each returns raw geometry in the shape renderer.mesh.create takes — positions, normals, uvs, colors, indices — so a caller can cache it, merge it or upload it.

local Geo = require("game.blocks.Geo")

Geo.chamferedPrism(a, b, h, chamfer)  -- a course of the tower
Geo.revolve(profile, segments)        -- the bell, the clapper, the sheave, a shaft
Geo.box(sx, sy, sz, "x"|"y"|"z")      -- a sawn timber, grain along the named axis
Geo.cylinder(radius, height, segs)    -- a rope or a pin
Geo.mergeInto(dst, src, pos, euler)   -- several pieces into one mesh

Two conventions the shaders in this folder read back:

  • uv — for a face of a stone, (signed metres along the face from its own centre, metres up from the bottom of the course) for a cap, (u, v) in the lozenge basis, in metres for a turned or sawn piece, (across the piece 0..1, along it in metres).
  • color — r face kind (0 side, 0.5 chamfered arris, 1 cap), g a per-face random, b the face's own length in metres divided by 8, a 1.

BELL_PROFILE, CLAPPER_PROFILE and SHEAVE_PROFILE are the polylines the revolve turns. A profile walked up the outside, over the crown and back down the inside gives a hollow shell whose normals turn over with it, which is how the bell gets a mouth you can see up into.