← AsiáticoObjeto 3Dfogon/campanilla-de-viento
Campanilla de viento
Arrastrá para girarlo// «Campanilla de viento» · gpt-6-sol (medium)
// A Japanese wind chime (furin) hanging from a small wooden post: a clear glass bell painted with a red goldfish, a small clapper inside, and a long paper strip with a blue wave hanging below it.
// Stone footing
box(5, 18, 0, 16, 30, 1, "#d6d3c8");
box(6, 19, 2, 15, 29, 2, "#eee9da");
box(7, 20, 3, 14, 28, 4, "#8e2724");
box(7, 20, 4, 14, 20, 4, "#d9ad5d");
// Lacquered post
box(9, 22, 5, 12, 26, 39, "#a9342a");
box(9, 22, 5, 9, 26, 39, "#742622");
box(10, 22, 5, 11, 22, 38, "#cb4932");
for (let z = 8; z < 38; z += 7) {
box(9, 21, z, 12, 21, z, "#d7a753");
}
box(8, 21, 5, 13, 27, 6, "#672521");
box(8, 21, 7, 13, 27, 7, "#dbb663");
box(8, 21, 37, 13, 27, 38, "#d9ad5d");
// Curved support beneath the arm
line(12, 24, 29, 21, 24, 39, 1, "#792824");
line(13, 23, 31, 20, 23, 39, 0, "#d5a451");
// Horizontal beam and little glazed canopy
box(8, 22, 39, 35, 26, 41, "#a8342a");
box(9, 21, 39, 35, 21, 40, "#c44632");
box(9, 21, 41, 35, 21, 41, "#edbb62");
box(7, 20, 42, 36, 28, 42, "#344c43");
box(9, 21, 43, 34, 27, 43, "#567569");
box(7, 20, 43, 9, 28, 44, "#44685c");
box(34, 20, 43, 36, 28, 44, "#44685c");
for (let x = 11; x <= 33; x += 4) {
line(x, 21, 43, x, 27, 43, 0, "#789283");
}
box(29, 21, 38, 33, 27, 38, "#d9ae60");
box(31, 23, 37, 31, 25, 39, "#ad854b");
// Everything below this hook swings together.
part("chime", [31, 24, 39]);
animate("chime", { type: "swing", axis: "x", speed: 2, amplitude: 0.3 });
// Suspension cord and glass crown
line(31, 24, 36, 31, 24, 38, 0, "#bda771");
box(30, 23, 35, 32, 25, 36, "#b5dce0");
set(30, 23, 36, "#efffff");
// Thin, partly open glass bell: the open front keeps the painted fish readable.
const radii = {
20: 9.5, 21: 9.5, 22: 8.9, 23: 8.3,
24: 8.1, 25: 8.1, 26: 8.1, 27: 8.1,
28: 8.1, 29: 8.0, 30: 7.9, 31: 7.5,
32: 6.8, 33: 5.7, 34: 4.2, 35: 2.7
};
for (let z = 20; z <= 35; z++) {
const r = radii[z];
for (let x = 20; x <= 42; x++) {
for (let y = 13; y <= 35; y++) {
const d = Math.hypot(x - 31, y - 24);
if (d > r || d < r - 1.2) continue;
const window = y < 24 && x >= 25 && x <= 37 &&
z >= 24 && z <= 31 && (x + z) % 4 !== 0;
if (window) continue;
let color = y < 23 ? "#a8dce1" : "#709da5";
if (z >= 32 || rand() < 0.14) color = "#d5f1ee";
set(x, y, z, color);
}
}
}
// Bright, flared lip and glass reflections
for (let x = 21; x <= 41; x++) {
for (let y = 14; y <= 34; y++) {
const d = Math.hypot(x - 31, y - 24);
if (d >= 8.4 && d <= 9.6) {
set(x, y, 20, y < 24 ? "#d2eddf" : "#84b6b7");
if ((x + y) % 3 !== 0) set(x, y, 21, "#81c5cb");
}
}
}
line(25, 18, 30, 27, 17, 33, 0, "#effffe");
line(26, 17, 28, 26, 17, 30, 0, "#f5ffff");
set(35, 17, 32, "#f4ffff");
// Red goldfish painted on the front of the glass
ellipsoid(31, 14, 27, 3, 0, 2, "#d64835");
box(30, 13, 28, 32, 13, 28, "#f47a43");
set(33, 13, 27, "#ed6740");
set(34, 14, 27, "#dc4030");
// Forked tail and fins
line(28, 14, 27, 25, 14, 29, 0, "#dc4437");
line(28, 14, 27, 25, 14, 25, 0, "#e65a3f");
set(25, 14, 30, "#ec7048");
set(25, 14, 24, "#ec7048");
line(30, 14, 29, 29, 14, 31, 0, "#f07648");
line(31, 14, 25, 29, 14, 23, 0, "#b92e30");
set(34, 12, 28, "#211e25");
set(34, 13, 28, "#fff2d6");
set(34, 12, 28, "#211e25");
set(36, 15, 26, "#dc6d50");
set(37, 16, 29, "#dc6d50");
// Clapper and its cord, visible through the bell
line(31, 24, 24, 31, 24, 19, 0, "#a88c67");
sphere(31, 23, 19, 2, "#d5ad5b");
set(30, 21, 20, "#ffdf83");
line(31, 23, 17, 31, 23, 19, 0, "#947a60");
// Long ivory paper tanzaku
box(28, 20, 3, 34, 21, 17, "#f2e9d4");
box(28, 20, 3, 28, 20, 17, "#fff8e8");
box(34, 20, 3, 34, 20, 17, "#d9cfba");
box(29, 20, 2, 33, 21, 2, "#e9ddc7");
box(29, 19, 16, 33, 19, 17, "#fdf7e6");
set(31, 19, 16, "#b63f32");
// Blue rolling waves painted down the face
for (let z = 4; z <= 13; z += 4) {
for (let x = 29; x <= 33; x++) set(x, 19, z, "#326c9f");
set(28, 19, z + 1, "#457eae");
set(29, 19, z + 2, "#3675a9");
set(30, 19, z + 2, "#3675a9");
set(31, 19, z + 1, "#224f85");
set(32, 19, z - 1, "#6499b9");
set(33, 19, z - 1, "#6499b9");
set(34, 19, z, "#457eae");
}
for (let z = 5; z <= 15; z += 4) {
set(30, 19, z, "#a8c8d2");
set(31, 19, z, "#f9f6e9");
}import { draw } from "./assets/voxel";
import { campanillaDeViento } from "./assets/campanilla-de-viento";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, campanillaDeViento, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: lo que mide en px su lado más largo
// angle: giro sobre el piso, en radianes
// t: segundos; si se mueve, se anima solo con eso# En una terminal, en la carpeta del juego
fogon assets add campanilla-de-viento
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["campanilla-de-viento"] })
# Queda en client/assets/campanilla-de-viento.ts
# https://fogon.page/object/campanilla-de-viento