← Basics3D assetfogon/violin
Violín
Drag to turn it// «Violín» · gpt-6-sol (medium)
// Violin («Violín»). Be faithful to the reference: keep thin parts thin (1–2 blocks: strings, necks, handles, legs, rods), keep its exact proportions and silhouette, and every visible detail (books on shelves, sound holes, tuning pegs, valves). Don't make it chunkier than the reference.
// Upright violin, with its bow resting beside the strings.
// The front faces -y.
const dark = "#352216";
const side = "#653719";
const amber = "#a65b22";
const gold = "#c98735";
const honey = "#dfaa57";
const light = "#f0c777";
const finger = "#342820";
const silver = "#d6d0b7";
// Violin body: a broad lower bout, pinched waist, and smaller upper bout.
const outline = [
[19, 28], [16, 31], [13, 34], [11, 36], [10, 37],
[10, 37], [11, 36], [12, 35], [14, 33], [16, 31],
[18, 29], [19, 28], [18, 29], [16, 31], [14, 33],
[13, 34], [13, 34], [14, 33], [15, 32], [17, 30],
[19, 28], [21, 26]
];
for (let z = 0; z < outline.length; z++) {
const [left, right] = outline[z];
for (let x = left; x <= right; x++) {
const edge = Math.min(x - left, right - x);
for (let y = 17; y <= 26; y++) {
let c;
if (y >= 24) c = dark;
else if (y >= 21) c = side;
else if (edge < 2) c = z > 13 ? "#81431b" : "#8d461b";
else if (y === 17) c = edge < 4 ? gold : amber;
else c = rand() < 0.13 ? "#b97029" : amber;
set(x, y, z, c);
}
// Raised golden purfling around the front rim.
if (edge === 1) set(x, 16, z, z > 13 ? gold : honey);
if (edge === 3 && z > 1 && z < 20) {
set(x, 16, z, "#75401d");
}
}
}
// Thin bright edge along the top and bottom curves.
for (let z of [2, 3, 17, 18, 19]) {
const [l, r] = outline[z];
for (let x = l + 3; x <= r - 3; x++) {
if (rand() > 0.26) set(x, 16, z, gold);
}
}
// Two black, curled f-holes, kept small against the wood.
for (const x of [17, 30]) {
const sign = x < 24 ? 1 : -1;
set(x, 15, 8, dark);
set(x + sign, 15, 9, dark);
set(x + sign, 15, 10, "#4a2918");
set(x, 15, 11, dark);
set(x, 15, 12, dark);
set(x - sign, 15, 13, dark);
set(x - sign, 15, 14, dark);
set(x, 15, 15, dark);
set(x + sign, 15, 15, "#58301a");
}
// Tailpiece, bridge, and the tiny central tail pin.
box(21, 13, 2, 26, 15, 6, finger);
box(22, 12, 1, 25, 13, 2, "#1c1d1b");
box(20, 14, 10, 27, 15, 11, honey);
box(21, 13, 11, 26, 14, 12, light);
box(23, 20, 0, 24, 26, 1, dark);
// Narrow neck and dark fingerboard.
box(21, 19, 20, 27, 25, 38, side);
box(22, 17, 22, 26, 19, 38, "#7c421f");
box(22, 15, 21, 26, 16, 37, finger);
box(21, 16, 20, 21, 19, 36, gold);
box(27, 16, 20, 27, 19, 36, "#603216");
// Four fine strings run from the tailpiece across the bridge and up the neck.
for (let i = 0; i < 4; i++) {
const x = 22 + i;
line(x, 12, 5, x, 12, 12, 0, silver);
line(x, 14, 13, x, 14, 37, 0, i === 0 ? "#ebdfb8" : "#bdb8a8");
}
// Pegbox and little side-projecting ebony tuning pegs.
box(20, 19, 37, 28, 25, 42, "#85491f");
box(21, 17, 38, 27, 19, 42, gold);
box(19, 21, 38, 20, 24, 39, "#25221f");
box(17, 21, 38, 19, 24, 40, "#25221f");
box(19, 21, 41, 20, 24, 42, "#302820");
box(28, 21, 39, 30, 24, 40, "#2b2520");
box(28, 21, 42, 29, 24, 43, "#302820");
// Squared, curled scroll with highlighted wooden ridges.
box(19, 19, 42, 29, 27, 44, "#75401e");
box(20, 17, 44, 28, 26, 45, gold);
box(22, 16, 45, 28, 23, 45, honey);
box(19, 20, 41, 21, 26, 44, side);
box(21, 17, 42, 22, 19, 44, "#e0a24f");
box(23, 16, 43, 26, 17, 44, "#a26028");
set(24, 15, 43, dark);
set(25, 15, 43, dark);
// Slender pale bow alongside the instrument: dark frog below,
// light hair and warm wooden stick above.
box(33, 11, 3, 36, 14, 6, "#262623");
box(32, 12, 5, 37, 14, 7, "#41403a");
box(34, 11, 7, 35, 12, 37, "#eee9d5");
box(36, 13, 8, 37, 14, 36, "#8c693d");
for (let z = 8; z <= 36; z++) {
if (z % 7 < 4) set(34, 10, z, "#f7f1dd");
if (z % 9 === 0) set(36, 12, z, "#c6bca2");
}
box(33, 11, 37, 36, 14, 39, "#c9b993");
box(34, 10, 39, 35, 12, 40, "#f0e8d1");import { draw } from "./assets/voxel";
import { violin } from "./assets/violin";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, violin, 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 violin
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["violin"] })
# It lands in client/assets/violin.ts
# https://fogon.page/object/violin