← Pirates and sea3D assetfogon/ojo-de-buey
Ojo de buey
Drag to turn it// «Ojo de buey» · gpt-6-sol (medium)
// A wall section of a ship hull, a square of warm brown planks with a big round brass porthole in the middle showing a turquoise sea view behind glass, with brass bolts around the rim.
const cx = 24, cz = 19;
const wood = ["#ad6637", "#b8733e", "#c58045", "#a76034"];
function inWindow(x, z, r = 10.3) {
return Math.hypot(x - cx, z - cz) <= r;
}
// Thick, square hull section, built from broad horizontal planks.
for (let z = 0; z <= 37; z++) {
const row = Math.floor(z / 5);
for (let x = 5; x <= 42; x++) {
if (inWindow(x, z)) continue;
const joint = z % 5 === 0;
const endJoint = (x === (row % 2 ? 17 : 29));
const base = wood[(row + Math.floor(x / 13)) % wood.length];
for (let y = 23; y <= 29; y++) {
let color = y >= 28 ? "#824829" : base;
if (joint) color = "#704127";
if (endJoint && z % 5 > 0) color = "#854b2b";
set(x, y, z, color);
}
set(x, 22, z, joint ? "#704127" :
z % 5 === 1 ? "#db9759" :
rand() < 0.075 ? "#d18a4c" : base);
}
}
// Chunky border timbers and bright edges.
for (let z = 0; z <= 37; z++) {
for (let x = 5; x <= 42; x++) {
if (x <= 7 || x >= 40 || z <= 2 || z >= 35) {
set(x, 21, z, (x === 5 || z === 37) ? "#e0a365" : "#93542e");
if (x === 7 || z === 35) set(x, 20, z, "#b97740");
}
}
}
// Small iron nail heads at the ends of the exposed planks.
for (let z = 3; z < 35; z += 5) {
for (const x of [9, 39]) {
set(x, 20, z, "#593d31");
set(x, 19, z, "#d8a359");
}
}
// Recessed round window: blue sky above a vivid turquoise sea.
for (let z = 9; z <= 29; z++) {
for (let x = 14; x <= 34; x++) {
const d = Math.hypot(x - cx, z - cz);
if (d > 9.35) continue;
let color;
if (z >= 22) color = z >= 26 ? "#8fe8e6" : "#67d5df";
else if (z >= 20) color = "#35bfd1";
else if (z >= 16) color = "#14babb";
else color = "#087f99";
// Lively bands of sunlit water.
if (z === 19 && x % 5 !== 0) color = "#a1f3dc";
if (z === 16 && x % 6 < 4) color = "#41d8c4";
if (z === 13 && x % 5 < 3) color = "#39bac2";
set(x, 21, z, color);
// A little golden sun, partly reflected in the water.
if (Math.hypot(x - 29, z - 25) <= 2.1) set(x, 20, z, "#ffe697");
if (z >= 17 && z <= 19 && Math.abs(x - 29) <= (z === 18 ? 2 : 1))
set(x, 20, z, "#e8edaa");
}
}
// Soft white wave crests, clipped to the round pane.
for (let x = 16; x <= 32; x++) {
let z = 17 + Math.round(Math.sin(x * 0.8));
if (Math.hypot(x - cx, z - cz) < 8.7 && x % 6 !== 0)
set(x, 20, z, "#e1fff0");
}
// Dark gasket, thick golden-brass rim, and raised polished inner lip.
for (let z = 4; z <= 34; z++) {
for (let x = 9; x <= 39; x++) {
const d = Math.hypot(x - cx, z - cz);
if (d >= 9.1 && d <= 13.7) {
set(x, 20, z, d > 12.9 ? "#684b2c" : "#986324");
if (d >= 9.7 && d <= 13.0)
set(x, 19, z, z > cz ? "#d99b38" : "#a46d27");
if (d >= 10.0 && d <= 12.65)
set(x, 18, z, z > cz || x < cx ? "#f2be50" : "#c68a31");
if (d >= 9.65 && d < 10.35)
set(x, 17, z, "#ffcf66");
if (d >= 12.0 && d <= 12.55 && z > cz)
set(x, 17, z, "#ffe08a");
}
}
}
// Twelve prominent, raised brass bolts around the rim.
for (let i = 0; i < 12; i++) {
const a = i * Math.PI / 6;
const x = Math.round(cx + Math.cos(a) * 11.35);
const z = Math.round(cz + Math.sin(a) * 11.35);
set(x, 16, z, "#825321");
set(x, 15, z, "#ffe083");
set(x, 14, z, "#fff0a7");
if (i % 3 === 0) set(x + 1, 16, z, "#f5bc4f");
}
// A few glass glints, safely inside the brass lip.
for (const [x, z] of [[17, 23], [18, 24], [19, 25], [20, 26], [18, 21], [30, 15], [31, 16]]) {
if (inWindow(x, z, 8.7)) set(x, 19, z, "#d3fff0");
}import { draw } from "./assets/voxel";
import { ojoDeBuey } from "./assets/ojo-de-buey";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, ojoDeBuey, 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 ojo-de-buey
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["ojo-de-buey"] })
# It lands in client/assets/ojo-de-buey.ts
# https://fogon.page/object/ojo-de-buey