← CiudadObjeto 3Dfogon/contenedor-de-basura
Contenedor de basura
Arrastrá para girarlo// «Contenedor de basura» · gpt-6-sol (medium)
// A large city garbage container on four small black wheels: a boxy grey-green plastic body wider than tall, with a slightly sloped hinged lid on top, a pedal bar at the bottom front, and a white stripe and recycling symbol on the front (-y). A black trash bag sticks out under the lid edge.
// Four-wheeled city recycling container. Front faces -y.
const body = "#71897b";
const bodyLight = "#859b8a";
const bodyDark = "#526b60";
const lid = "#91a596";
const lidLight = "#a8b9a8";
const lidDark = "#61786b";
const white = "#f2f2dc";
// Four small rubber wheels, mounted outside the body.
for (const y of [16, 33]) {
for (const x of [4, 40]) {
cylinder(x, y, 2, 2, 4, "#22282a", "x");
cylinder(x, y, 2, 1, 4, "#343d3d", "x");
}
set(4, y, 2, "#89918a");
set(43, y, 2, "#89918a");
}
// Solid molded-plastic body and its slightly projecting front.
box(7, 12, 5, 40, 36, 24, body);
box(7, 11, 7, 40, 11, 23, body);
box(6, 13, 7, 6, 35, 23, bodyDark);
box(41, 13, 7, 41, 35, 23, bodyDark);
// Subtle texture on the broad plastic faces.
forEach((x, y, z, color) => {
if (color === body && z >= 8 && z <= 22 && rand() < 0.065) {
if (y === 11) set(x, y, z, rand() < 0.55 ? bodyLight : "#687f72");
else if (z === 24) set(x, y, z, bodyLight);
}
});
// Reinforced corners, lower molding and top rim.
for (const x of [7, 40]) {
box(x, 11, 7, x, 11, 23, bodyDark);
box(x, 12, 6, x, 35, 7, bodyDark);
}
box(7, 11, 5, 40, 12, 6, "#53695e");
box(6, 11, 23, 41, 37, 25, bodyDark);
box(7, 11, 25, 40, 37, 25, bodyLight);
box(7, 10, 23, 40, 10, 24, "#60796a");
// Two quiet vertical molded ribs on the front.
for (const x of [11, 36]) {
box(x, 10, 12, x, 10, 21, "#82998a");
}
// A black bag bulges out from beneath the front edge of the lid.
ellipsoid(33, 9, 25, 5, 3, 4, "#202526");
ellipsoid(31, 7, 24, 3, 1, 3, "#303638");
ellipsoid(35, 8, 26, 2, 2, 3, "#171d1e");
line(34, 9, 27, 35, 9, 30, 1, "#22282a");
box(34, 8, 29, 36, 10, 30, "#161b1c");
line(29, 7, 25, 30, 7, 27, 0, "#47504e");
// Chunky hinged lid: stepped rows give its top a gentle rise toward the back.
const rows = [
[9, 15, 27, 29],
[16, 23, 28, 30],
[24, 30, 29, 31],
[31, 38, 30, 32]
];
for (const [y0, y1, bottom, top] of rows) {
box(6, y0, bottom, 41, y1, top, lid);
box(6, y0, bottom, 6, y1, top - 1, lidDark);
box(41, y0, bottom, 41, y1, top - 1, lidDark);
box(7, y0, top, 40, y1, top, lidLight);
}
box(6, 8, 26, 41, 9, 28, lidDark);
box(7, 8, 28, 40, 8, 28, "#b4c3af");
box(6, 37, 29, 41, 39, 30, lidDark);
// Speckles only on the upward-facing lid surfaces.
for (const [y0, y1, , top] of rows) {
for (let y = y0; y <= y1; y++) {
for (let x = 8; x <= 39; x++) {
if (rand() < 0.055) set(x, y, top, "#99ae9d");
}
}
}
// Hinges visible at the rear.
for (const x of [12, 34]) {
box(x, 38, 27, x + 3, 39, 31, "#435b51");
box(x + 1, 39, 29, x + 2, 39, 30, "#abb8a8");
}
// Broad white reflective stripe, with a little sky-blue civic color.
box(9, 10, 9, 38, 10, 11, white);
box(9, 10, 12, 38, 10, 12, "#91c8be");
box(9, 10, 8, 38, 10, 8, "#405d55");
// Recycling arrows, drawn large and blocky on the front.
const logoY = 10;
const mark = (x0, z0, x1, z1) =>
line(x0, logoY, z0, x1, logoY, z1, 0, white);
mark(19, 15, 23, 22);
mark(23, 22, 27, 22);
mark(27, 22, 25, 24);
mark(27, 22, 25, 20);
mark(28, 21, 32, 15);
mark(32, 15, 29, 13);
mark(29, 13, 32, 13);
mark(29, 13, 30, 16);
mark(28, 13, 20, 13);
mark(20, 13, 18, 16);
mark(18, 16, 18, 13);
mark(18, 16, 21, 16);
// Foot-operated lift bar and its two sturdy brackets.
for (const x of [15, 32]) {
box(x, 9, 3, x + 2, 12, 6, "#353f3c");
}
box(14, 7, 2, 34, 9, 3, "#3d4944");
box(15, 7, 4, 33, 8, 4, "#9daaa0");
for (const x of [17, 29]) {
box(x, 6, 3, x + 2, 6, 4, "#dfbf57");
}import { draw } from "./assets/voxel";
import { contenedorDeBasura } from "./assets/contenedor-de-basura";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, contenedorDeBasura, 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 contenedor-de-basura
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["contenedor-de-basura"] })
# Queda en client/assets/contenedor-de-basura.ts
# https://fogon.page/object/contenedor-de-basura