← GranjaObjeto 3Dfogon/gallinero
Gallinero
Arrastrá para girarlo// «Gallinero» · gpt-6-sol (medium)
// A small wooden chicken coop raised on four short legs: red plank walls with white trim, a sloped brown shingle roof, a small arched doorway with a little wooden ramp with cross slats going down to the ground, a side nesting box with a hinged lid and two white eggs visible in straw, and a small fenced run of chicken wire next to it.
// Sunny chicken coop and fenced run
const red = ["#a82f2d", "#bb3934", "#c8473b", "#d65142"];
const white = "#fff5e4", shadowWhite = "#d8d6c8";
const wood = "#a96b36", darkWood = "#744526";
const straw = "#eac754", wire = "#aab4b2";
// Little patches of grass beneath and around the coop.
for (let x = 3; x <= 45; x++) {
for (let y = 3; y <= 39; y++) {
if (rand() < 0.14) set(x, y, 0, rand() < 0.5 ? "#77be48" : "#91ce52");
}
}
// Four stout raised legs.
for (const x of [12, 28]) for (const y of [17, 31]) {
box(x - 1, y - 1, 0, x + 1, y + 1, 10, darkWood);
box(x - 1, y - 1, 2, x, y, 9, wood);
}
// Raised floor and its white edge.
box(10, 14, 9, 30, 33, 10, darkWood);
box(10, 13, 10, 30, 13, 10, white);
box(10, 14, 11, 30, 33, 27, "#8e2928");
// Painted horizontal planks, leaving the middle hollow.
for (let z = 11; z <= 27; z++) {
const c = red[Math.floor((z - 11) / 4) % red.length];
box(10, 14, z, 30, 15, z, c);
box(10, 32, z, 30, 33, z, c);
box(10, 16, z, 11, 31, z, c);
box(29, 16, z, 30, 31, z, c);
}
box(12, 16, 11, 28, 31, 26, null);
for (const z of [14, 18, 22, 26]) {
box(11, 13, z, 29, 13, z, "#8e2828");
box(9, 16, z, 9, 32, z, "#922b28");
box(31, 16, z, 31, 32, z, "#922b28");
}
// Crisp corner boards and base trim.
for (const x of [10, 29]) {
box(x, 13, 10, x + 1, 13, 28, white);
box(x, 33, 10, x + 1, 34, 28, white);
}
box(10, 13, 27, 30, 13, 28, white);
box(10, 34, 27, 30, 34, 28, shadowWhite);
box(9, 15, 10, 9, 32, 11, white);
box(31, 15, 10, 31, 32, 11, shadowWhite);
// Front-facing gable under the roof.
for (let x = 10; x <= 30; x++) {
const top = Math.floor(35 - Math.abs(x - 20) * 0.67);
box(x, 14, 28, x, 15, top - 2, red[Math.floor(x / 3) % 4]);
box(x, 32, 28, x, 33, top - 2, "#a73430");
}
// Arched dark doorway, cut through the front wall.
for (let x = 17; x <= 23; x++) for (let z = 10; z <= 18; z++) {
set(x, 13, z, null);
set(x, 14, z, null);
set(x, 15, z, null);
set(x, 16, z, "#483027");
}
for (let x = 17; x <= 23; x++) for (let z = 19; z <= 22; z++) {
if ((x - 20) ** 2 + (z - 18) ** 2 <= 16) {
for (let y = 13; y <= 15; y++) set(x, y, z, null);
set(x, 16, z, "#483027");
}
}
for (const x of [16, 24]) box(x, 12, 10, x, 13, 18, white);
for (let x = 16; x <= 24; x++) for (let z = 18; z <= 23; z++) {
const d = Math.sqrt((x - 20) ** 2 + (z - 18) ** 2);
if (d > 3.5 && d <= 4.8 && z >= 18) set(x, 12, z, white);
}
box(17, 12, 9, 23, 13, 9, shadowWhite);
// A tiny round gable vent.
for (let x = 17; x <= 23; x++) for (let z = 27; z <= 32; z++) {
const d = Math.sqrt((x - 20) ** 2 + (z - 29) ** 2);
if (d <= 1.5) set(x, 13, z, "#4b342b");
else if (d <= 2.5) set(x, 13, z, white);
}
box(19, 12, 29, 21, 12, 29, shadowWhite);
// Wide pitched shingle roof, ridge running front to back.
for (let x = 7; x <= 33; x++) {
const z = Math.floor(35 - Math.abs(x - 20) * 0.67);
for (let y = 11; y <= 36; y++) {
const tile = (Math.floor(y / 3) + Math.floor(x / 4)) % 3;
const c = ["#87502f", "#9f6238", "#b77742"][tile];
set(x, y, z, rand() < 0.09 ? "#c58a50" : c);
set(x, y, z - 1, "#694029");
if (y % 3 === 0) set(x, y, z, "#70432b");
}
set(x, 10, z, white);
set(x, 37, z, shadowWhite);
}
box(19, 11, 35, 21, 36, 35, "#bb7c45");
// Slatted ramp descending toward the viewer.
for (let y = 2; y <= 14; y++) {
const z = Math.floor((y - 2) * 0.72);
box(17, y, z, 23, y, z, wood);
box(17, y, z - 1, 23, y, z - 1, darkWood);
if (y % 2 === 0) box(17, y, z + 1, 23, y, z + 1, "#d39755");
set(17, y, z + 2, darkWood);
set(23, y, z + 2, darkWood);
}
// Side nesting box: open straw-filled top, eggs, and an upright hinged lid.
box(2, 18, 12, 10, 30, 16, "#965631");
box(2, 18, 17, 10, 18, 19, "#b67642");
box(2, 30, 17, 10, 30, 19, "#94552f");
box(2, 19, 17, 2, 29, 19, "#b67642");
box(10, 19, 17, 10, 29, 19, "#9b5c33");
box(3, 19, 17, 9, 29, 17, straw);
for (let i = 0; i < 55; i++) {
const x = 3 + Math.floor(rand() * 7);
const y = 19 + Math.floor(rand() * 11);
set(x, y, 18, rand() < 0.5 ? "#f5dc74" : "#cda443");
}
ellipsoid(5, 22, 19, 1.5, 2, 1.7, "#fff9e9");
ellipsoid(8, 26, 19, 1.5, 2, 1.7, "#f5edda");
set(5, 21, 20, "#ffffff");
set(8, 25, 20, "#ffffff");
box(1, 18, 15, 1, 30, 15, white);
box(2, 17, 12, 10, 17, 13, white);
box(2, 18, 12, 2, 30, 13, shadowWhite);
// Lid is propped almost upright at its rear hinge.
for (let y = 27; y <= 31; y++) {
const z = 27 - (y - 27) * 2;
box(1, y, z, 11, y, z + 1, y % 2 ? "#86502f" : "#a96b3d");
}
box(1, 27, 27, 11, 27, 27, "#cf9354");
box(3, 30, 20, 4, 31, 20, wire);
box(9, 30, 20, 10, 31, 20, wire);
// Open-topped chicken-wire run beside the coop.
for (const [x, y] of [[34, 12], [45, 12], [34, 37], [45, 37]]) {
box(x, y, 0, x + 1, y + 1, 13, "#8e9390");
box(x, y, 13, x + 1, y + 1, 14, "#d4d8cd");
}
for (let x = 34; x <= 45; x += 2) {
for (let z = 2; z <= 11; z++) {
set(x, 12, z, wire);
set(x, 37, z, wire);
}
}
for (let y = 12; y <= 37; y += 2) {
for (let z = 2; z <= 11; z++) set(45, y, z, wire);
}
for (const z of [2, 5, 8, 11, 13]) {
box(34, 12, z, 45, 12, z, z === 13 ? "#d0d2c9" : wire);
box(34, 37, z, 45, 37, z, wire);
box(45, 13, z, 45, 36, z, wire);
}
// Little framed gate at the front.
box(37, 12, 0, 37, 12, 12, "#d4d8cd");
box(34, 11, 10, 37, 11, 10, "#d4d8cd");
set(36, 11, 6, "#d7aa46");
// A chunky white hen inside the run.
ellipsoid(40, 25, 4, 3, 3, 3, "#f4f0df");
ellipsoid(40, 22, 7, 2, 2, 2, "#fffaf0");
ellipsoid(38, 25, 5, 1.5, 2, 1.5, "#dfddce");
box(42, 26, 5, 43, 27, 8, "#fffaf0");
set(40, 20, 7, "#eeae36"); // beak facing front
set(39, 20, 8, "#292823");
set(41, 20, 8, "#292823");
set(40, 22, 10, "#d94b3e");
set(39, 22, 9, "#e65341");
set(41, 22, 9, "#e65341");
for (const x of [39, 41]) {
box(x, 24, 0, x, 24, 2, "#d29a38");
box(x - 1, 22, 0, x + 1, 24, 0, "#d29a38");
}
// A few bright tufts around the ramp and fence.
for (const [x, y] of [[7, 9], [28, 5], [32, 8], [43, 8], [35, 32], [44, 34]]) {
line(x, y, 0, x, y, 2, 0, "#61af3d");
set(x - 1, y, 1, "#8aca4b");
set(x + 1, y, 1, "#8aca4b");
}import { draw } from "./assets/voxel";
import { gallinero } from "./assets/gallinero";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, gallinero, 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 gallinero
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["gallinero"] })
# Queda en client/assets/gallinero.ts
# https://fogon.page/object/gallinero