diff --git a/media/kit.png b/media/kit.png index 73a473b..c7370ca 100644 Binary files a/media/kit.png and b/media/kit.png differ diff --git a/models.lock.json b/models.lock.json index 4e52a4b..f6a3cb9 100644 --- a/models.lock.json +++ b/models.lock.json @@ -67,7 +67,7 @@ "address": "@medieval-kit/wooden-barrel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.620Z", + "installedAt": "2026-08-23T09:56:44.512Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-barrel\\model.ts", @@ -82,7 +82,7 @@ "address": "@medieval-kit/core", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.590Z", + "installedAt": "2026-08-23T09:56:44.478Z", "files": [ { "path": "src\\models\\medieval-kit\\core\\geometry.ts", @@ -129,7 +129,7 @@ "address": "@medieval-kit/wooden-crate", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.624Z", + "installedAt": "2026-08-23T09:56:44.517Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-crate\\model.ts", @@ -144,7 +144,7 @@ "address": "@medieval-kit/kit", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.630Z", + "installedAt": "2026-08-23T09:56:44.525Z", "files": [], "dependencies": [] }, @@ -152,7 +152,7 @@ "address": "@medieval-kit/iron-anvil", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.600Z", + "installedAt": "2026-08-23T09:56:44.490Z", "files": [ { "path": "src\\models\\medieval-kit\\iron-anvil\\model.ts", @@ -167,7 +167,7 @@ "address": "@medieval-kit/wooden-bucket", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.622Z", + "installedAt": "2026-08-23T09:56:44.515Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-bucket\\model.ts", @@ -182,7 +182,7 @@ "address": "@medieval-kit/wooden-fence", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.625Z", + "installedAt": "2026-08-23T09:56:44.519Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-fence\\model.ts", @@ -197,7 +197,7 @@ "address": "@medieval-kit/wooden-hoe", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.626Z", + "installedAt": "2026-08-23T09:56:44.520Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-hoe\\model.ts", @@ -212,7 +212,7 @@ "address": "@medieval-kit/wooden-ladder", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.627Z", + "installedAt": "2026-08-23T09:56:44.521Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-ladder\\model.ts", @@ -227,7 +227,7 @@ "address": "@medieval-kit/wooden-pitchfork", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.628Z", + "installedAt": "2026-08-23T09:56:44.523Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-pitchfork\\model.ts", @@ -242,7 +242,7 @@ "address": "@medieval-kit/wooden-shovel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.629Z", + "installedAt": "2026-08-23T09:56:44.524Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-shovel\\model.ts", @@ -257,7 +257,7 @@ "address": "@medieval-kit/wooden-stool", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.630Z", + "installedAt": "2026-08-23T09:56:44.525Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-stool\\model.ts", @@ -272,7 +272,7 @@ "address": "@medieval-kit/cart-wheel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.593Z", + "installedAt": "2026-08-23T09:56:44.482Z", "files": [ { "path": "src\\models\\medieval-kit\\cart-wheel\\model.ts", @@ -287,7 +287,7 @@ "address": "@medieval-kit/log-pile", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.606Z", + "installedAt": "2026-08-23T09:56:44.497Z", "files": [ { "path": "src\\models\\medieval-kit\\log-pile\\model.ts", @@ -302,7 +302,7 @@ "address": "@medieval-kit/trestle-table", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.616Z", + "installedAt": "2026-08-23T09:56:44.507Z", "files": [ { "path": "src\\models\\medieval-kit\\trestle-table\\model.ts", @@ -317,7 +317,7 @@ "address": "@medieval-kit/wooden-chest", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.623Z", + "installedAt": "2026-08-23T09:56:44.516Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-chest\\model.ts", @@ -332,7 +332,7 @@ "address": "@medieval-kit/hay-bale", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.599Z", + "installedAt": "2026-08-23T09:56:44.489Z", "files": [ { "path": "src\\models\\medieval-kit\\hay-bale\\model.ts", @@ -347,7 +347,7 @@ "address": "@medieval-kit/pitch-torch", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.608Z", + "installedAt": "2026-08-23T09:56:44.500Z", "files": [ { "path": "src\\models\\medieval-kit\\pitch-torch\\model.ts", @@ -362,7 +362,7 @@ "address": "@medieval-kit/wooden-bench", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.621Z", + "installedAt": "2026-08-23T09:56:44.514Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-bench\\model.ts", @@ -377,7 +377,7 @@ "address": "@medieval-kit/linen-sack", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.604Z", + "installedAt": "2026-08-23T09:56:44.496Z", "files": [ { "path": "src\\models\\medieval-kit\\linen-sack\\model.ts", @@ -392,7 +392,7 @@ "address": "@medieval-kit/oak-tankard", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.607Z", + "installedAt": "2026-08-23T09:56:44.498Z", "files": [ { "path": "src\\models\\medieval-kit\\oak-tankard\\model.ts", @@ -407,7 +407,7 @@ "address": "@medieval-kit/straw-broom", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.613Z", + "installedAt": "2026-08-23T09:56:44.505Z", "files": [ { "path": "src\\models\\medieval-kit\\straw-broom\\model.ts", @@ -422,7 +422,7 @@ "address": "@medieval-kit/bronze-bell", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.592Z", + "installedAt": "2026-08-23T09:56:44.480Z", "files": [ { "path": "src\\models\\medieval-kit\\bronze-bell\\model.ts", @@ -437,7 +437,7 @@ "address": "@medieval-kit/iron-lantern", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.602Z", + "installedAt": "2026-08-23T09:56:44.493Z", "files": [ { "path": "src\\models\\medieval-kit\\iron-lantern\\model.ts", @@ -452,7 +452,7 @@ "address": "@medieval-kit/tavern-sign", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.615Z", + "installedAt": "2026-08-23T09:56:44.506Z", "files": [ { "path": "src\\models\\medieval-kit\\tavern-sign\\model.ts", @@ -467,7 +467,7 @@ "address": "@medieval-kit/coin-pouch", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.594Z", + "installedAt": "2026-08-23T09:56:44.483Z", "files": [ { "path": "src\\models\\medieval-kit\\coin-pouch\\model.ts", @@ -482,7 +482,7 @@ "address": "@medieval-kit/glass-phial", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.597Z", + "installedAt": "2026-08-23T09:56:44.486Z", "files": [ { "path": "src\\models\\medieval-kit\\glass-phial\\model.ts", @@ -497,7 +497,7 @@ "address": "@medieval-kit/leather-book", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.603Z", + "installedAt": "2026-08-23T09:56:44.495Z", "files": [ { "path": "src\\models\\medieval-kit\\leather-book\\model.ts", @@ -512,7 +512,7 @@ "address": "@medieval-kit/wicker-basket", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.618Z", + "installedAt": "2026-08-23T09:56:44.511Z", "files": [ { "path": "src\\models\\medieval-kit\\wicker-basket\\model.ts", @@ -527,7 +527,7 @@ "address": "@medieval-kit/post-mill", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.609Z", + "installedAt": "2026-08-23T09:56:44.501Z", "files": [ { "path": "src\\models\\medieval-kit\\post-mill\\model.ts", @@ -542,7 +542,7 @@ "address": "@medieval-kit/stone-well", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.612Z", + "installedAt": "2026-08-23T09:56:44.504Z", "files": [ { "path": "src\\models\\medieval-kit\\stone-well\\model.ts", @@ -557,7 +557,7 @@ "address": "@medieval-kit/hand-cart", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.598Z", + "installedAt": "2026-08-23T09:56:44.488Z", "files": [ { "path": "src\\models\\medieval-kit\\hand-cart\\model.ts", @@ -572,7 +572,7 @@ "address": "@medieval-kit/iron-cauldron", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.601Z", + "installedAt": "2026-08-23T09:56:44.492Z", "files": [ { "path": "src\\models\\medieval-kit\\iron-cauldron\\model.ts", @@ -587,7 +587,7 @@ "address": "@medieval-kit/vegetables", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.617Z", + "installedAt": "2026-08-23T09:56:44.509Z", "files": [ { "path": "src\\models\\medieval-kit\\vegetables\\model.ts", @@ -602,11 +602,11 @@ "address": "@medieval-kit/forge-hearth", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.595Z", + "installedAt": "2026-08-23T09:56:44.485Z", "files": [ { "path": "src\\models\\medieval-kit\\forge-hearth\\model.ts", - "sourceHash": "7166bb0f728b7b1945b64f18565d48dd60ecf47be4e9d4048874e358e96abcbe" + "sourceHash": "8b200a9e702cae87dbae6aac609a0645863163f775bbff983ede45b72ed97fe4" } ], "dependencies": [ @@ -617,11 +617,11 @@ "address": "@medieval-kit/round-shield", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T08:46:30.611Z", + "installedAt": "2026-08-23T09:56:44.503Z", "files": [ { "path": "src\\models\\medieval-kit\\round-shield\\model.ts", - "sourceHash": "a2d1166c9f54298e8d0f7e556082cfbcd6cbb591b0c5f4782fa3a8284aa1e438" + "sourceHash": "2c4d955d61db499fd5bdb5a4247a98809dc2aefe0b0802650da1aac050fd8fff" } ], "dependencies": [ diff --git a/my-registry/README.md b/my-registry/README.md index 33549f2..1e801f0 100644 --- a/my-registry/README.md +++ b/my-registry/README.md @@ -26,7 +26,7 @@ Configure `models.json` first so the namespace resolves: ## Models -32 models and one shared lib. Addresses are `@medieval-kit/`. This table is +34 models and one shared lib. Addresses are `@medieval-kit/`. This table is generated from the models themselves with `bun scripts/catalog-table.ts` — a hand-written list goes stale on the first model you add, and this one already did once. @@ -63,10 +63,12 @@ did once. | `iron-cauldron` | Lighting | 1134 | 3 | 1.09×1.37×1.10 | stone, iron, char, ember | | | `hand-cart` | Structure | 2044 | 4 | 0.88×1.03×2.60 | oak, iron | | | `vegetables` | Props | 1718 | 2 | 0.60×0.12×0.59 | produce | | +| `round-shield` | Arms | 729 | 3 | 0.73×0.73×0.17 | oak, leather, iron | | +| `forge-hearth` | Smithy | 1354 | 4 | 2.14×1.78×0.87 | stone, char, ember, oak, leather, iron | | | `stone-well` | Structure | 1376 | 4 | 1.88×2.00×1.28 | stone, oak, iron, cloth | | | `post-mill` | Structure | 1672 | 4 | 6.60×7.23×6.98 | oak, iron | | -**26 939 triangles** in total. The whole kit in one scene costs less than a +**29 022 triangles** in total. The whole kit in one scene costs less than a single mid-complexity character model. Every model depends on `@medieval-kit/core`, a shared support item holding the diff --git a/my-registry/models/forge-hearth/model.ts b/my-registry/models/forge-hearth/model.ts index 3d9d518..790f775 100644 --- a/my-registry/models/forge-hearth/model.ts +++ b/my-registry/models/forge-hearth/model.ts @@ -155,54 +155,90 @@ export function createModel(overrides: Partial = {}) { tint('stone', 0.03 + jitter(random, 0.08)), )) } + // String courses: thin bands standing proud of each wall. + // + // The walls are slabs, which is what pays for the kerb, and a slab of one + // colour is a slab however much it is mottled -- the body of the forge + // came out as a smooth grey box under a course of real stones. Three + // ribs to a face, twelve boxes in all, is enough to say COURSED without + // laying two hundred blocks. They stand proud rather than sitting flush, + // because a dry wall's stones never line up on one plane and a rib that + // is level with its wall is invisible. + for (const at of [0.22, 0.5, 0.78]) { + for (const [dx, dz, sx, sz] of [ + [0, -(D + wall * 0.12) / 2, L * 0.99, wall * 0.12], + [0, (D + wall * 0.12) / 2, L * 0.99, wall * 0.12], + [-(L + wall * 0.12) / 2, 0, wall * 0.12, D * 0.99], + [(L + wall * 0.12) / 2, 0, wall * 0.12, D * 0.99], + ] as const) { + masonry.push(taperedBoxGeometry( + [sx, sz], + [sx * 0.99, sz * 0.9], + bodyTop * 0.055, + [dx, floor + bodyTop * at, dz], + tint('stone', -0.07 + jitter(random, 0.05)), + )) + } + } + const hearth = mergeColoured(masonry) roughenGeometry(hearth, wall * 0.05, { salt: 23 }) // --- Fire ------------------------------------------------------------ - const bedR = Math.min(L, D) * 0.5 - wall * 0.9 + // The bed is LUMPS, not a plate. + // + // A smooth disc of charcoal colour is the darkest value in the palette + // spread flat, and it reads as a hole cut in the hearth with a few sparks + // in it. A fire bed is broken: irregular lumps of charcoal with the glow + // coming up BETWEEN them, and the only way to get that from vertex colour + // is to build the lumps. They are cheap -- five-sided prisms, eight + // triangles each -- and they are the whole difference between a forge and + // a stone box with a black lid. + const bedX = L * 0.5 - wall * 1.1 + const bedZ = D * 0.5 - wall * 1.1 const bedY = floor + bodyTop - const coal = latheGeometry( - [ - { y: bedY, radius: bedR * 1.02 }, - { y: bedY + kerbH * 0.5, radius: bedR * 0.86 }, - ] as Level[], - // Darker than the stone by a wide margin. At +0.03 the charcoal came - // out the same value as the masonry around it and the fire bed read as - // another slab of rock. - 9, [0, 0, 0], tint('char', -0.02), - ) - coal.scale(L / (Math.min(L, D)), 1, D / (Math.min(L, D))) - + const coals: BufferGeometry[] = [] const embers: BufferGeometry[] = [] - for (let i = 0; i < 16; i += 1) { + const lumps = 26 + + for (let i = 0; i < lumps; i += 1) { + // Golden-angle spiral over an ellipse, so the bed fills evenly rather + // than ringing. const a = i * 2.399963 - const r = bedR * 0.7 * Math.sqrt((i + 0.4) / 16) - const size = bedR * (0.12 + random() * 0.09) - // Bedded INTO the charcoal, with no bottom face and no two of them - // lying flat. - // - // Sitting on the bed at one height, every ember presented a horizontal - // cap in the same plane as the charcoal's own top face, and the z-fight - // check found them at once. Burying the base removes the face that was - // colliding -- it is inside the fire and nobody can see it -- and the - // tilt means what is left is not horizontal to begin with. Coals in a - // fire are half-sunk and lying every way anyhow. + const ring = Math.sqrt((i + 0.35) / lumps) + const size = Math.min(bedX, bedZ) * (0.16 + random() * 0.13) + // The middle of a working fire is where the air arrives, so that is + // where it glows; the edges are burnt out. + const hot = ring < 0.52 && i % 2 === 0 const lump = prismGeometry( - size, size * 0.55, size * 0.7, 5, [0, 0, 0], - tint(i % 3 === 0 ? 'emberTip' : 'ember', jitter(random, 0.05), 0.4), + size, size * 0.5, size * 0.8, 5, [0, 0, 0], + hot + ? tint(i % 3 === 0 ? 'emberTip' : 'ember', jitter(random, 0.05), 0.4) + : tint('char', 0.05 + jitter(random, 0.08)), { capBottom: false }, ) - lump.rotateX(jitter(random, 0.45)) - lump.rotateZ(jitter(random, 0.45)) + lump.rotateX(jitter(random, 0.5)) + lump.rotateZ(jitter(random, 0.5)) lump.rotateY(random() * Math.PI * 2) lump.translate( - Math.sin(a) * r * (L / Math.min(L, D)), - bedY + kerbH * 0.3, - Math.cos(a) * r * (D / Math.min(L, D)), + Math.sin(a) * bedX * 0.78 * ring, + bedY + kerbH * (hot ? 0.34 : 0.26), + Math.cos(a) * bedZ * 0.78 * ring, ) - embers.push(lump) + ;(hot ? embers : coals).push(lump) } + // A dark floor under the lumps so the bed is not see-through where they + // do not quite meet. + coals.push(taperedBoxGeometry( + [bedX * 1.9, bedZ * 1.9], + [bedX * 1.8, bedZ * 1.8], + kerbH * 0.4, + [0, bedY + kerbH * 0.16, 0], + tint('char', 0.02), + )) + const coal = mergeColoured(coals) + // --- Chimney ---------------------------------------------------------- // Rises from the BACK of the hearth and tapers. Its foot reaches down // inside the kerb rather than standing on it, so the joint is an overlap. @@ -284,12 +320,16 @@ export function createModel(overrides: Partial = {}) { // One gusset of leather spanning board to board, and two ribs on it at // different sizes so no two of their faces can line up. + // The leather BULGES past the boards. Cut narrower than them it sat + // hidden in the gap and the bellows read as a stack of loose planks with + // daylight between; a bellows is a bag under pressure and its widest + // point is the leather, not the wood. hide.push(lay(dishedSheetGeometry( - teardrop(0.94, D * 0.2), 5, tint('leather', -0.06, 0.9), + teardrop(1.18, D * 0.235), 5, tint('leather', -0.06, 0.9), )).translate(bx + D * 0.032, bellowsY, 0)) for (const [i, at] of [-0.34, 0.34].entries()) { hide.push(lay(dishedSheetGeometry( - teardrop(1.04 + i * 0.07, D * 0.035), 5, + teardrop(1.26 + i * 0.07, D * 0.03), 5, tint('leather', -0.01 + i * 0.04, 0.9), )).translate(bx + D * (0.022 + i * 0.019), bellowsY + at * D * 0.11, 0)) } diff --git a/my-registry/models/round-shield/model.ts b/my-registry/models/round-shield/model.ts index 566b561..c051dd6 100644 --- a/my-registry/models/round-shield/model.ts +++ b/my-registry/models/round-shield/model.ts @@ -62,7 +62,9 @@ export const roundShieldDefaults: RoundShieldConfig = { radius: 0.36, planks: 9, thickness: 0.016, - lean: 0.22, + // Barely off vertical. A shield propped against something stands almost + // upright; at 0.22 it read as lying back against nothing. + lean: 0.12, hue: 0.02, rivets: 10, seed: 83, @@ -83,11 +85,15 @@ export function createModel(overrides: Partial = {}) { const planks = Math.max(3, Math.round(config.planks)) const hue = ((config.hue % 1) + 1) % 1 + // Saturated and dark. At 0.42 saturation and 0.34 lightness the face + // came out pastel against a reference whose red and blue are deep enough + // to read as pigment ground in oil -- which is what they were. Shield + // paint is not a wash. const paint = (h: number, dark: number): Color => new Color().setHSL( (h + jitter(random, 0.01) + 1) % 1, - 0.42 + jitter(random, 0.06), - dark + jitter(random, 0.04), + 0.66 + jitter(random, 0.05), + dark + jitter(random, 0.03), ) // --- Boards --------------------------------------------------------- @@ -96,8 +102,8 @@ export function createModel(overrides: Partial = {}) { // already have to make anyway. const boards: BufferGeometry[] = [] const step = (R * 2) / planks - const upper = paint(hue, 0.34) - const lower = paint((hue + 0.55) % 1, 0.3) + const upper = paint(hue, 0.26) + const lower = paint((hue + 0.55) % 1, 0.23) for (let i = 0; i < planks; i += 1) { const x = -R + step * (i + 0.5) @@ -127,12 +133,40 @@ export function createModel(overrides: Partial = {}) { // A rawhide binding folded over the edge. It is a band whose thickness // reaches INSIDE the boards' own radius, so it grips them rather than // sitting against their ends. + // Thick enough to SWALLOW the plank ends. + // + // The boards are rectangles cut to the chord of the circle, so their ends + // step in and out around the edge -- unavoidable, since a plank is + // straight and the outline is not. A real rim hides exactly that: it is a + // wide band of hide folded over the ends and stitched, and it is what + // turns a stack of boards into a disc. At 0.055 of the radius it was too + // narrow to cover the steps and the silhouette came out serrated. const rim = bandGeometry( - R * 1.02, 0, T * 2.6, R * 0.055, planks * 3, + R * 1.02, 0, T * 3.2, R * 0.105, planks * 3, tint('leather', -0.04, 0.9), { inner: true }, ) rim.rotateX(Math.PI / 2) + // The cross between the quarters, laid ON the face. + // + // Two bands of pale paint dividing the four quarters. It is the detail + // that makes a quartered shield read at a distance -- without it the + // quarters meet edge to edge and the eye sees two colours rather than a + // device. Proud of the boards rather than inlaid, because paint is. + const trim: BufferGeometry[] = [] + const band = R * 0.1 + const cream = new Color().setHSL(0.11, 0.24, 0.74) + for (const vertical of [false, true]) { + const arm = taperedBoxGeometry( + vertical ? [band, T * 0.5] : [R * 1.94, T * 0.5], + vertical ? [band * 0.97, T * 0.4] : [R * 1.9, T * 0.4], + vertical ? R * 1.94 : band, + [0, 0, T * 0.62], + new Color(cream), + ) + trim.push(arm) + } + // --- Boss ----------------------------------------------------------- const bossR = R * 0.26 const iron: BufferGeometry[] = [] @@ -193,7 +227,7 @@ export function createModel(overrides: Partial = {}) { )) } - const face = mergeColoured([...boards, ...back]) + const face = mergeColoured([...boards, ...trim, ...back]) const boss = mergeColoured(iron) // Leaned back from UPRIGHT, not tipped up from flat. diff --git a/src/models/medieval-kit/forge-hearth/model.ts b/src/models/medieval-kit/forge-hearth/model.ts index 3d9d518..790f775 100644 --- a/src/models/medieval-kit/forge-hearth/model.ts +++ b/src/models/medieval-kit/forge-hearth/model.ts @@ -155,54 +155,90 @@ export function createModel(overrides: Partial = {}) { tint('stone', 0.03 + jitter(random, 0.08)), )) } + // String courses: thin bands standing proud of each wall. + // + // The walls are slabs, which is what pays for the kerb, and a slab of one + // colour is a slab however much it is mottled -- the body of the forge + // came out as a smooth grey box under a course of real stones. Three + // ribs to a face, twelve boxes in all, is enough to say COURSED without + // laying two hundred blocks. They stand proud rather than sitting flush, + // because a dry wall's stones never line up on one plane and a rib that + // is level with its wall is invisible. + for (const at of [0.22, 0.5, 0.78]) { + for (const [dx, dz, sx, sz] of [ + [0, -(D + wall * 0.12) / 2, L * 0.99, wall * 0.12], + [0, (D + wall * 0.12) / 2, L * 0.99, wall * 0.12], + [-(L + wall * 0.12) / 2, 0, wall * 0.12, D * 0.99], + [(L + wall * 0.12) / 2, 0, wall * 0.12, D * 0.99], + ] as const) { + masonry.push(taperedBoxGeometry( + [sx, sz], + [sx * 0.99, sz * 0.9], + bodyTop * 0.055, + [dx, floor + bodyTop * at, dz], + tint('stone', -0.07 + jitter(random, 0.05)), + )) + } + } + const hearth = mergeColoured(masonry) roughenGeometry(hearth, wall * 0.05, { salt: 23 }) // --- Fire ------------------------------------------------------------ - const bedR = Math.min(L, D) * 0.5 - wall * 0.9 + // The bed is LUMPS, not a plate. + // + // A smooth disc of charcoal colour is the darkest value in the palette + // spread flat, and it reads as a hole cut in the hearth with a few sparks + // in it. A fire bed is broken: irregular lumps of charcoal with the glow + // coming up BETWEEN them, and the only way to get that from vertex colour + // is to build the lumps. They are cheap -- five-sided prisms, eight + // triangles each -- and they are the whole difference between a forge and + // a stone box with a black lid. + const bedX = L * 0.5 - wall * 1.1 + const bedZ = D * 0.5 - wall * 1.1 const bedY = floor + bodyTop - const coal = latheGeometry( - [ - { y: bedY, radius: bedR * 1.02 }, - { y: bedY + kerbH * 0.5, radius: bedR * 0.86 }, - ] as Level[], - // Darker than the stone by a wide margin. At +0.03 the charcoal came - // out the same value as the masonry around it and the fire bed read as - // another slab of rock. - 9, [0, 0, 0], tint('char', -0.02), - ) - coal.scale(L / (Math.min(L, D)), 1, D / (Math.min(L, D))) - + const coals: BufferGeometry[] = [] const embers: BufferGeometry[] = [] - for (let i = 0; i < 16; i += 1) { + const lumps = 26 + + for (let i = 0; i < lumps; i += 1) { + // Golden-angle spiral over an ellipse, so the bed fills evenly rather + // than ringing. const a = i * 2.399963 - const r = bedR * 0.7 * Math.sqrt((i + 0.4) / 16) - const size = bedR * (0.12 + random() * 0.09) - // Bedded INTO the charcoal, with no bottom face and no two of them - // lying flat. - // - // Sitting on the bed at one height, every ember presented a horizontal - // cap in the same plane as the charcoal's own top face, and the z-fight - // check found them at once. Burying the base removes the face that was - // colliding -- it is inside the fire and nobody can see it -- and the - // tilt means what is left is not horizontal to begin with. Coals in a - // fire are half-sunk and lying every way anyhow. + const ring = Math.sqrt((i + 0.35) / lumps) + const size = Math.min(bedX, bedZ) * (0.16 + random() * 0.13) + // The middle of a working fire is where the air arrives, so that is + // where it glows; the edges are burnt out. + const hot = ring < 0.52 && i % 2 === 0 const lump = prismGeometry( - size, size * 0.55, size * 0.7, 5, [0, 0, 0], - tint(i % 3 === 0 ? 'emberTip' : 'ember', jitter(random, 0.05), 0.4), + size, size * 0.5, size * 0.8, 5, [0, 0, 0], + hot + ? tint(i % 3 === 0 ? 'emberTip' : 'ember', jitter(random, 0.05), 0.4) + : tint('char', 0.05 + jitter(random, 0.08)), { capBottom: false }, ) - lump.rotateX(jitter(random, 0.45)) - lump.rotateZ(jitter(random, 0.45)) + lump.rotateX(jitter(random, 0.5)) + lump.rotateZ(jitter(random, 0.5)) lump.rotateY(random() * Math.PI * 2) lump.translate( - Math.sin(a) * r * (L / Math.min(L, D)), - bedY + kerbH * 0.3, - Math.cos(a) * r * (D / Math.min(L, D)), + Math.sin(a) * bedX * 0.78 * ring, + bedY + kerbH * (hot ? 0.34 : 0.26), + Math.cos(a) * bedZ * 0.78 * ring, ) - embers.push(lump) + ;(hot ? embers : coals).push(lump) } + // A dark floor under the lumps so the bed is not see-through where they + // do not quite meet. + coals.push(taperedBoxGeometry( + [bedX * 1.9, bedZ * 1.9], + [bedX * 1.8, bedZ * 1.8], + kerbH * 0.4, + [0, bedY + kerbH * 0.16, 0], + tint('char', 0.02), + )) + const coal = mergeColoured(coals) + // --- Chimney ---------------------------------------------------------- // Rises from the BACK of the hearth and tapers. Its foot reaches down // inside the kerb rather than standing on it, so the joint is an overlap. @@ -284,12 +320,16 @@ export function createModel(overrides: Partial = {}) { // One gusset of leather spanning board to board, and two ribs on it at // different sizes so no two of their faces can line up. + // The leather BULGES past the boards. Cut narrower than them it sat + // hidden in the gap and the bellows read as a stack of loose planks with + // daylight between; a bellows is a bag under pressure and its widest + // point is the leather, not the wood. hide.push(lay(dishedSheetGeometry( - teardrop(0.94, D * 0.2), 5, tint('leather', -0.06, 0.9), + teardrop(1.18, D * 0.235), 5, tint('leather', -0.06, 0.9), )).translate(bx + D * 0.032, bellowsY, 0)) for (const [i, at] of [-0.34, 0.34].entries()) { hide.push(lay(dishedSheetGeometry( - teardrop(1.04 + i * 0.07, D * 0.035), 5, + teardrop(1.26 + i * 0.07, D * 0.03), 5, tint('leather', -0.01 + i * 0.04, 0.9), )).translate(bx + D * (0.022 + i * 0.019), bellowsY + at * D * 0.11, 0)) } diff --git a/src/models/medieval-kit/round-shield/model.ts b/src/models/medieval-kit/round-shield/model.ts index 566b561..c051dd6 100644 --- a/src/models/medieval-kit/round-shield/model.ts +++ b/src/models/medieval-kit/round-shield/model.ts @@ -62,7 +62,9 @@ export const roundShieldDefaults: RoundShieldConfig = { radius: 0.36, planks: 9, thickness: 0.016, - lean: 0.22, + // Barely off vertical. A shield propped against something stands almost + // upright; at 0.22 it read as lying back against nothing. + lean: 0.12, hue: 0.02, rivets: 10, seed: 83, @@ -83,11 +85,15 @@ export function createModel(overrides: Partial = {}) { const planks = Math.max(3, Math.round(config.planks)) const hue = ((config.hue % 1) + 1) % 1 + // Saturated and dark. At 0.42 saturation and 0.34 lightness the face + // came out pastel against a reference whose red and blue are deep enough + // to read as pigment ground in oil -- which is what they were. Shield + // paint is not a wash. const paint = (h: number, dark: number): Color => new Color().setHSL( (h + jitter(random, 0.01) + 1) % 1, - 0.42 + jitter(random, 0.06), - dark + jitter(random, 0.04), + 0.66 + jitter(random, 0.05), + dark + jitter(random, 0.03), ) // --- Boards --------------------------------------------------------- @@ -96,8 +102,8 @@ export function createModel(overrides: Partial = {}) { // already have to make anyway. const boards: BufferGeometry[] = [] const step = (R * 2) / planks - const upper = paint(hue, 0.34) - const lower = paint((hue + 0.55) % 1, 0.3) + const upper = paint(hue, 0.26) + const lower = paint((hue + 0.55) % 1, 0.23) for (let i = 0; i < planks; i += 1) { const x = -R + step * (i + 0.5) @@ -127,12 +133,40 @@ export function createModel(overrides: Partial = {}) { // A rawhide binding folded over the edge. It is a band whose thickness // reaches INSIDE the boards' own radius, so it grips them rather than // sitting against their ends. + // Thick enough to SWALLOW the plank ends. + // + // The boards are rectangles cut to the chord of the circle, so their ends + // step in and out around the edge -- unavoidable, since a plank is + // straight and the outline is not. A real rim hides exactly that: it is a + // wide band of hide folded over the ends and stitched, and it is what + // turns a stack of boards into a disc. At 0.055 of the radius it was too + // narrow to cover the steps and the silhouette came out serrated. const rim = bandGeometry( - R * 1.02, 0, T * 2.6, R * 0.055, planks * 3, + R * 1.02, 0, T * 3.2, R * 0.105, planks * 3, tint('leather', -0.04, 0.9), { inner: true }, ) rim.rotateX(Math.PI / 2) + // The cross between the quarters, laid ON the face. + // + // Two bands of pale paint dividing the four quarters. It is the detail + // that makes a quartered shield read at a distance -- without it the + // quarters meet edge to edge and the eye sees two colours rather than a + // device. Proud of the boards rather than inlaid, because paint is. + const trim: BufferGeometry[] = [] + const band = R * 0.1 + const cream = new Color().setHSL(0.11, 0.24, 0.74) + for (const vertical of [false, true]) { + const arm = taperedBoxGeometry( + vertical ? [band, T * 0.5] : [R * 1.94, T * 0.5], + vertical ? [band * 0.97, T * 0.4] : [R * 1.9, T * 0.4], + vertical ? R * 1.94 : band, + [0, 0, T * 0.62], + new Color(cream), + ) + trim.push(arm) + } + // --- Boss ----------------------------------------------------------- const bossR = R * 0.26 const iron: BufferGeometry[] = [] @@ -193,7 +227,7 @@ export function createModel(overrides: Partial = {}) { )) } - const face = mergeColoured([...boards, ...back]) + const face = mergeColoured([...boards, ...trim, ...back]) const boss = mergeColoured(iron) // Leaned back from UPRIGHT, not tipped up from flat.