← Basics3D assetfogon/camioneta-v3
Camioneta
Drag to turn it// «Camioneta» · gpt-6-sol (medium)
// Pickup truck («Camioneta»). One of several variations of this object: follow the reference picture closely.
const blue = "#17607d";
const blueDark = "#10445c";
const blueMid = "#207491";
const blueLight = "#338faf";
const roofBlue = "#298bad";
const glass = "#193a48";
const glassLight = "#315767";
const metal = "#a6afb0";
const metalDark = "#657477";
const tire = "#242b2e";
function speckledBox(x0, y0, z0, x1, y1, z1, base, fleck) {
box(x0, y0, z0, x1, y1, z1, base);
for (let x = x0; x <= x1; x++)
for (let y = y0; y <= y1; y++)
for (let z = z0; z <= z1; z++)
if (rand() < 0.035) set(x, y, z, fleck);
}
// Chassis and the long, squared-off blue body.
box(13, 5, 7, 35, 43, 10, "#263b43");
box(12, 5, 10, 36, 43, 12, blueDark);
speckledBox(12, 6, 12, 36, 42, 14, blue, blueMid);
box(13, 5, 14, 35, 19, 15, blueMid);
// Broad, flat hood with raised stamped lines.
box(13, 5, 15, 35, 18, 16, blueLight);
box(15, 7, 17, 33, 17, 17, "#287fa0");
box(18, 7, 18, 19, 16, 18, "#3998b7");
box(29, 7, 18, 30, 16, 18, "#3998b7");
box(14, 5, 16, 34, 6, 16, "#14536c");
box(12, 7, 11, 12, 18, 14, "#287d9a");
box(36, 7, 11, 36, 18, 14, "#287d9a");
// Cab: upright windshield, stout pillars and overhanging roof.
box(13, 18, 15, 35, 31, 23, blueDark);
box(14, 18, 18, 34, 18, 23, glass);
box(15, 17, 19, 33, 17, 23, glassLight);
box(17, 17, 20, 30, 17, 22, glass);
box(13, 17, 17, 15, 19, 24, blueMid);
box(33, 17, 17, 35, 19, 24, blueMid);
// Side windows, divided by the central door pillars.
for (const x of [12, 36]) {
box(x, 20, 18, x, 29, 23, glass);
box(x, 21, 19, x, 24, 22, glassLight);
box(x, 25, 18, x, 26, 24, blueMid);
box(x, 19, 17, x, 19, 24, blueMid);
box(x, 29, 17, x, 30, 24, blueMid);
box(x, 19, 17, x, 30, 17, "#328eaa");
box(x, 20, 15, x, 29, 16, blue);
box(x, 26, 14, x, 28, 14, "#9bacaa");
box(x, 30, 11, x, 30, 16, "#103d52"); // Door gap.
}
box(12, 18, 24, 36, 30, 25, roofBlue);
box(14, 19, 26, 34, 29, 26, "#3596b7");
box(13, 18, 26, 35, 19, 26, "#175c79");
box(13, 29, 26, 35, 30, 26, "#185b76");
box(12, 20, 23, 12, 29, 24, "#247d9a");
box(36, 20, 23, 36, 29, 24, "#247d9a");
// Open pickup bed, with thick blue rails.
box(13, 31, 12, 35, 43, 13, "#354952");
box(14, 32, 14, 34, 42, 14, "#263840");
for (const x of [12, 36]) {
box(x, 31, 13, x, 43, 17, blue);
box(x, 31, 18, x, 43, 18, blueLight);
box(x, 32, 15, x, 42, 16, blueMid);
}
box(13, 43, 13, 35, 44, 17, blue);
box(13, 43, 18, 35, 44, 18, blueLight);
box(13, 31, 14, 35, 32, 17, blueDark);
box(13, 31, 18, 35, 31, 18, blueMid);
// Golden cargo box visible above the bed.
box(20, 34, 14, 30, 40, 20, "#a96b2e");
box(21, 34, 20, 29, 39, 20, "#d89a49");
box(20, 34, 15, 20, 40, 19, "#c18436");
box(30, 34, 15, 30, 40, 19, "#e2a653");
box(20, 36, 17, 30, 36, 17, "#e4aa58");
box(20, 39, 17, 30, 39, 17, "#865122");
box(24, 34, 15, 24, 34, 19, "#e6ae61");
box(27, 40, 15, 27, 40, 19, "#744922");
// Dark wheel wells, then chunky tires and light steel rims.
for (const cy of [12, 38]) {
for (const x of [11, 12, 36, 37])
for (let y = cy - 6; y <= cy + 6; y++)
for (let z = 3; z <= 12; z++)
if ((y - cy) ** 2 + (z - 5) ** 2 <= 37)
set(x, y, z, "#172c36");
for (const side of [-1, 1]) {
const inner = side < 0 ? 8 : 37;
const outer = side < 0 ? 11 : 40;
for (let x = inner; x <= outer; x++)
for (let y = cy - 5; y <= cy + 5; y++)
for (let z = 0; z <= 10; z++) {
const d = (y - cy) ** 2 + (z - 5) ** 2;
if (d <= 30) {
let c = d > 21 ? "#171d20" : tire;
if (d > 23 && (y + z) % 3 === 0) c = "#354043";
if (x === inner || x === outer) {
if (d <= 13) c = "#747e7e";
if (d <= 8) c = "#abb2ae";
if (d <= 2) c = "#586568";
}
set(x, y, z, c);
}
}
}
}
// Front face: dark grille, warm square lamps and a projecting bumper.
box(16, 4, 10, 32, 4, 13, "#2b3c41");
for (let x = 18; x <= 30; x += 3)
box(x, 3, 10, x, 3, 12, "#75888a");
for (const x of [13, 33]) {
box(x, 3, 12, x + 2, 4, 14, "#e5d7a0");
box(x, 3, 11, x + 2, 3, 11, "#a66e37");
}
box(12, 2, 8, 36, 3, 9, metal);
box(14, 2, 7, 34, 2, 7, metalDark);
box(12, 4, 9, 13, 6, 10, "#b8babc");
box(35, 4, 9, 36, 6, 10, "#b8babc");
// Rear bumper, side steps, mirrors and small trim.
box(12, 44, 8, 36, 45, 9, metalDark);
for (const x of [10, 38]) {
box(x, 20, 8, x, 29, 8, metal);
box(x, 21, 9, x, 28, 9, "#52686c");
}
for (const x of [9, 39]) {
box(x, 17, 19, x, 20, 21, "#27373b");
box(x, 17, 20, x, 18, 21, "#7b8989");
}
box(10, 19, 19, 12, 19, 19, metalDark);
box(36, 19, 19, 38, 19, 19, metalDark);import { draw } from "./assets/voxel";
import { camionetaV3 } from "./assets/camioneta-v3";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, camionetaV3, 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 camioneta-v3
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["camioneta-v3"] })
# It lands in client/assets/camioneta-v3.ts
# https://fogon.page/object/camioneta-v3