← Casa completaObjeto 3Dfogon/tostadora
Tostadora
Arrastrá para girarlo// «Tostadora» · gpt-6-sol (medium)
// A retro chrome toaster: a rounded silver box with two slots on top, two slices of golden toast popping out of them, a little black lever on the side and a dial on the front.
// Rubber feet
for (const x of [12, 32]) for (const y of [15, 31]) {
box(x, y, 0, x + 4, y + 4, 3, "#555b60");
box(x + 1, y, 0, x + 3, y + 4, 1, "#373c40");
}
// Rounded chrome body
for (let z = 3; z <= 29; z++) {
const inset = z === 29 ? 2 : z === 28 ? 1 : 0;
for (let y = 10 + inset; y <= 37 - inset; y++) {
for (let x = 7 + inset; x <= 40 - inset; x++) {
const cx = Math.max(10 + inset, Math.min(37 - inset, x));
const cy = Math.max(13 + inset, Math.min(34 - inset, y));
if ((x - cx) ** 2 + (y - cy) ** 2 > 10) continue;
let color = "#c9d2d3";
if (z <= 5) color = "#858f93";
else if (z >= 27) color = z === 29 ? "#e9eeee" : "#dce4e4";
else if (y <= 12) color = "#dce3e2";
else if (x <= 9 || x >= 38) color = "#aab6ba";
if (z > 5 && z < 27 && (x === 11 || x === 12 || x === 35)) color = "#edf1ee";
if (z > 6 && z < 26 && x >= 17 && x <= 20 && y <= 12) color = "#b7c3c5";
if (z > 6 && z < 27 && rand() < 0.035) color = "#e2e9e8";
set(x, y, z, color);
}
}
}
// Bright rolled edges and a soft, pale front panel
for (let x = 11; x <= 36; x++) {
set(x, 9, 6, "#9da9ad");
set(x, 9, 25, "#f1f3ee");
set(x, 10, 27, "#f5f5ee");
}
box(12, 9, 8, 35, 9, 23, "#e1e7e5");
box(13, 8, 9, 17, 8, 22, "#f3f3ec");
box(19, 8, 9, 20, 8, 22, "#bdc9cb");
box(33, 8, 9, 34, 8, 22, "#f5f6f0");
for (let x = 12; x <= 35; x++) {
set(x, 8, 23, "#f4f5ef");
set(x, 8, 8, "#aebabc");
}
// Two recessed slots, with thick polished lips
for (const [x0, x1] of [[10, 23], [25, 38]]) {
for (let x = x0; x <= x1; x++)
for (let y = 16; y <= 32; y++) {
const edge = x === x0 || x === x1 || y === 16 || y === 32;
if (edge) {
set(x, y, 29, "#f5f5ee");
set(x, y, 28, "#b6c2c5");
} else {
set(x, y, 29, null);
set(x, y, 28, null);
set(x, y, 27, "#343d42");
set(x, y, 26, "#59636a");
}
}
for (let x = x0 + 1; x < x1; x++) {
set(x, 17, 29, "#ffffff");
set(x, 31, 29, "#aab9bc");
}
}
// Front vents, a cheerful indicator light, and a chunky temperature dial
for (let z = 17; z <= 21; z += 2) {
box(23, 8, z, 30, 8, z, "#aab6b9");
box(24, 7, z, 29, 7, z, "#707e83");
}
box(14, 7, 11, 17, 7, 14, "#aeb8b7");
box(15, 6, 12, 16, 6, 13, "#f2aa61");
set(15, 5, 13, "#ffe3a0");
// Dial: concentric chrome ring, dark face, cream knob, and pointer
for (let dx = -5; dx <= 5; dx++)
for (let dz = -5; dz <= 5; dz++) {
const d = dx * dx + dz * dz;
if (d <= 25) set(29 + dx, 7, 13 + dz, d >= 17 ? "#899a9f" : "#ecf0ec");
if (d <= 17) set(29 + dx, 6, 13 + dz, d >= 12 ? "#f9faf4" : "#75868c");
if (d <= 9) set(29 + dx, 5, 13 + dz, "#e5e8e0");
if (d <= 4) set(29 + dx, 4, 13 + dz, "#fbf5e7");
}
line(29, 3, 13, 30, 3, 15, 0, "#65767b");
for (const [x, z] of [[23, 13], [25, 17], [29, 19], [33, 17], [35, 13]])
set(x, 6, z, "#65767b");
// Slot and black grip for the lever on the right side
box(40, 20, 10, 41, 27, 23, "#8d9b9f");
box(41, 21, 12, 41, 26, 21, "#30383d");
box(42, 22, 16, 44, 25, 18, "#a3afb1");
box(43, 20, 15, 45, 27, 19, "#33383b");
box(45, 21, 16, 45, 26, 18, "#20272b");
box(43, 20, 19, 44, 26, 19, "#555b5d");
// Both slices rise together out of their slots.
part("toast", [24, 23, 29]);
for (const left of [11, 26]) {
for (let x = left; x <= left + 11; x++)
for (let y = 20; y <= 26; y++)
for (let z = 27; z <= 40; z++) {
const u = x - left;
let inside = z <= 35;
if (z === 36 || z === 37) inside = u >= 0 && u <= 11;
if (z === 38) inside = u >= 1 && u <= 10;
if (z === 39) inside = u >= 2 && u <= 9 && u !== 5 && u !== 6;
if (z === 40) inside = (u >= 3 && u <= 4) || (u >= 7 && u <= 8);
if (!inside) continue;
const crust = u <= 1 || u >= 10 || z >= 38 || z === 27;
let color = crust ? "#b8793e" : "#efc484";
if (crust && (y === 20 || z >= 39)) color = "#d99a50";
if (!crust && y === 20) {
color = rand() < 0.18 ? "#dca35f" : "#f2cd91";
if (rand() < 0.07) color = "#f8dda7";
}
if (!crust && y >= 25) color = "#f5d59a";
set(x, y, z, color);
}
// Toasted patches and an easy-to-read golden rim on the front face
for (let x = left + 2; x <= left + 9; x++)
for (let z = 30; z <= 36; z++)
if (rand() < 0.14) set(x, 19, z, "#e0aa68");
for (let x = left + 2; x <= left + 9; x++)
for (let z = 29; z <= 37; z++)
if (!get(x, 19, z)) set(x, 19, z, "#f1c98d");
for (let z = 29; z <= 37; z++) {
set(left + 1, 19, z, "#bc7d40");
set(left + 10, 19, z, "#c78945");
}
}
animate("toast", { type: "bob", axis: "z", speed: 3, amplitude: 2 });import { draw } from "./assets/voxel";
import { tostadora } from "./assets/tostadora";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, tostadora, 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 tostadora
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["tostadora"] })
# Queda en client/assets/tostadora.ts
# https://fogon.page/object/tostadora