← City3D assetfogon/cono-de-transito
Cono de tránsito
Drag to turn it// «Cono de tránsito» · gpt-6-sol (medium)
// A traffic cone: a tall orange cone rising from a square black rubber base, with two wide white reflective bands around it, slightly worn, with a little rounded tip.
// Square rubber base with clipped corners and a raised lip.
for (let z = 0; z <= 3; z++) {
const inset = z === 3 ? 2 : z === 2 ? 1 : 0;
const lo = 7 + inset, hi = 40 - inset;
for (let x = lo; x <= hi; x++) {
for (let y = lo; y <= hi; y++) {
const corner = Math.min(x - lo, hi - x) + Math.min(y - lo, hi - y);
if (corner < 2) continue;
const edge = Math.min(x - lo, hi - x, y - lo, hi - y);
let color = z === 0 ? "#171a1b" : z === 3 ? "#34383a" : "#25292b";
if (edge === 0 && z > 0) color = "#414547";
else if (rand() < 0.045) color = "#303436";
set(x, y, z, color);
}
}
}
// Subtle molded grooves across the front of the rubber base.
for (let x = 12; x <= 35; x += 5) {
box(x, 8, 1, x + 1, 8, 1, "#393d3e");
}
// Low dark collar where the cone meets its base.
cylinder(24, 24, 4, 14, 2, "#292c2b");
cylinder(24, 24, 5, 13, 1, "#41413a");
// Solid tapered cone, with two broad reflective stripes.
for (let z = 6; z <= 36; z++) {
const radius = 12.8 - (z - 6) * 0.355;
const band = (z >= 13 && z <= 16) || (z >= 24 && z <= 27);
for (let x = Math.floor(24 - radius); x <= Math.ceil(24 + radius); x++) {
for (let y = Math.floor(24 - radius); y <= Math.ceil(24 + radius); y++) {
const d = Math.hypot(x - 24, y - 24);
if (d > radius) continue;
const front = y < 23;
const upperEdge = z === 16 || z === 27;
let color;
if (band) {
color = upperEdge ? "#f9f4e7" : front ? "#fffdf2" : "#dcded7";
if (rand() < 0.065) color = front ? "#e4e4d9" : "#c8cbc4";
// A few small worn spots, mostly at the stripe edges.
if (d > radius - 1.4 && rand() < 0.025)
color = "#d66b25";
} else {
color = front ? "#f5822a" : "#df6722";
if (y > 27) color = "#ca591e";
if (d > radius - 1.3 && x < 22 && front) color = "#ff9636";
if (rand() < 0.055) color = front ? "#ed7425" : "#d36021";
}
set(x, y, z, color);
}
}
}
// Soft, slightly rounded orange tip.
ellipsoid(24, 24, 36, 2.2, 2.2, 2, "#ed7828");
set(23, 23, 37, "#ff9636");
set(24, 23, 38, "#f68a30");import { draw } from "./assets/voxel";
import { conoDeTransito } from "./assets/cono-de-transito";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, conoDeTransito, 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 cono-de-transito
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["cono-de-transito"] })
# It lands in client/assets/cono-de-transito.ts
# https://fogon.page/object/cono-de-transito