← Parties and Christmas3D assetfogon/muerdago
Muérdago
Drag to turn it// «Muérdago» · gpt-6-sol (medium)
// A sprig of mistletoe hanging from a short arched wooden stand: a bunch of oval light green leaves with clusters of small round white berries, tied with a red velvet ribbon bow at the top.
// Short wooden stand with broad feet and a curved arch.
const wood = "#a76532";
const woodLight = "#ca8950";
const woodDark = "#754321";
const gold = "#f3c95e";
box(4, 19, 0, 13, 32, 2, woodDark);
box(5, 20, 2, 12, 31, 3, woodLight);
box(35, 19, 0, 44, 32, 2, woodDark);
box(36, 20, 2, 43, 31, 3, woodLight);
for (const x of [7, 38]) {
box(x, 23, 4, x + 3, 28, 29, wood);
box(x, 22, 4, x + 3, 22, 29, woodLight);
box(x, 28, 4, x + 3, 28, 29, woodDark);
// Simple carved grain on the front of each post.
for (let z = 7; z < 27; z += 6) {
line(x + 1, 21, z, x + 1, 21, z + 3, 0, "#dfaa69");
}
set(x + 1, 21, 6, gold);
set(x + 1, 21, 26, gold);
}
// An arch made from overlapping solid timber segments.
for (let x = 8; x <= 40; x++) {
const rise = Math.sqrt(Math.max(0, 1 - ((x - 24) / 17) ** 2));
const z = Math.round(28 + 11 * rise);
box(x, 23, z - 2, x, 28, z + 1, wood);
box(x, 22, z - 2, x, 22, z + 1, woodLight);
set(x, 21, z - 2, "#e5ae6b");
if (x % 5 === 0) set(x, 22, z + 1, "#db9b5c");
}
// Gold hook beneath the crown of the arch.
line(24, 20, 36, 24, 20, 33, 1, gold);
set(24, 18, 36, "#fff1a9");
// Hanging mistletoe stems, behind the leaves.
const stem = "#448b46";
line(24, 19, 33, 24, 19, 23, 1, stem);
const branches = [
[15, 18, 28], [14, 18, 22], [19, 18, 16],
[34, 18, 28], [35, 18, 22], [30, 18, 16]
];
for (const [x, y, z] of branches) {
line(24, 19, 26, x, y, z, 0, stem);
}
// Plump, pointed oval leaves. Their veins face the viewer (-y).
function leaf(x0, z0, x1, z1, shade) {
const dx = x1 - x0, dz = z1 - z0;
const length = Math.hypot(dx, dz);
const nx = -dz / length, nz = dx / length;
const steps = Math.ceil(length * 2);
for (let i = 1; i <= steps; i++) {
const t = i / steps;
const width = 2.65 * Math.pow(Math.sin(Math.PI * t), 0.8);
const cx = x0 + dx * t, cz = z0 + dz * t;
for (let w = -width; w <= width; w += 0.65) {
const x = Math.round(cx + nx * w);
const z = Math.round(cz + nz * w);
set(x, 19, z, "#378b42");
set(x, 18, z, shade);
if (Math.abs(w) < width - 0.45) set(x, 17, z, shade);
if (w < -0.7 && t > 0.24 && t < 0.78) set(x, 16, z, "#9bdb70");
}
}
for (let i = 2; i < steps - 1; i++) {
const t = i / steps;
set(x0 + dx * t, 15, z0 + dz * t, "#c3eb88");
}
}
leaf(23, 27, 15, 29, "#66b957");
leaf(22, 25, 14, 22, "#78c75e");
leaf(23, 23, 19, 16, "#63b653");
leaf(25, 27, 34, 29, "#7dca60");
leaf(26, 25, 35, 22, "#66bd57");
leaf(25, 23, 30, 16, "#82ca65");
// Cream-white berry clusters sit in front of the foliage.
const berries = [
[21, 24], [24, 26], [27, 24], [19, 21],
[23, 21], [27, 20], [30, 23], [24, 18]
];
for (const [x, z] of berries) {
sphere(x, 13, z, 1.55, "#ede9d9");
set(x, 11, z, "#ffffff");
set(x - 1, 12, z + 1, "#ffffff");
set(x, 13, z - 1, "#d4d6c6");
}
// Plush red velvet bow, with two broad loops, a knot, and ribbon tails.
ellipsoid(20, 15, 33, 4, 2, 2.6, "#b51632");
ellipsoid(28, 15, 33, 4, 2, 2.6, "#b51632");
ellipsoid(19, 13, 34, 2.5, 0.8, 1.2, "#ef4b57");
ellipsoid(29, 13, 34, 2.5, 0.8, 1.2, "#ef4b57");
ellipsoid(20, 12, 32, 2, 0.7, 0.7, "#8d1732");
ellipsoid(28, 12, 32, 2, 0.7, 0.7, "#8d1732");
line(23, 15, 32, 20, 15, 26, 1, "#b51632");
line(25, 15, 32, 29, 15, 26, 1, "#b51632");
line(22, 13, 31, 20, 13, 27, 0, "#ee4353");
line(26, 13, 31, 29, 13, 27, 0, "#ee4353");
ellipsoid(24, 12, 33, 2, 2, 2, "#ce2340");
set(23, 10, 34, "#ff7380");
set(24, 10, 34, "#ff7380");import { draw } from "./assets/voxel";
import { muerdago } from "./assets/muerdago";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, muerdago, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: its longest side, in px
// angle: turn on the floor, in radians
// t: seconds; if it moves, that animates it# In a terminal, in the game's folder
fogon assets add muerdago
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["muerdago"] })
# It lands in client/assets/muerdago.ts
# https://fogon.page/object/muerdago