← AsiáticoObjeto 3Dfogon/dragon-chino
Dragón chino
Arrastrá para girarlo// «Dragón chino» · gpt-6-sol (medium)
// A long red-and-gold Chinese dragon coiled in an S shape on a cloud-shaped base: scaled body, golden belly, green mane along the back, horns, whiskers, big head with open mouth. The head is a moving part and the tail tip another.
// Cloud-shaped stone base
part("body");
ellipsoid(24, 24, 2, 17, 14, 2.5, "#d5dbd8");
const clouds = [
[10, 20, 3, 5, 5], [15, 32, 3, 6, 5], [25, 36, 3, 7, 4],
[37, 30, 3, 5, 6], [38, 19, 3, 5, 5], [27, 13, 3, 7, 5],
[16, 13, 3, 6, 5]
];
for (const [x, y, z, rx, ry] of clouds) {
ellipsoid(x, y, z, rx, ry, 3, "#e8e9df");
ellipsoid(x - 1, y - 1, z + 1, rx * .7, ry * .65, 1.5, "#fff5e7");
}
for (let i = 0; i < 38; i++) {
const a = i * Math.PI * 2 / 38;
const x = 24 + 17 * Math.cos(a), y = 24 + 14 * Math.sin(a);
if (get(x, y, 2)) sphere(x, y, 3.7, .55, "#fff9ed");
}
// The dragon's long, rising S-shaped coil.
const coil = [
[35, 33, 18], [30, 35, 16], [23, 35, 15], [16, 32, 14],
[13, 26, 13], [16, 21, 13], [23, 19, 14], [30, 20, 16],
[34, 25, 19], [31, 29, 21], [25, 29, 23], [19, 26, 24],
[16, 21, 26], [17, 17, 29]
];
const samples = [];
for (let j = 0; j < coil.length - 1; j++) {
const a = coil[j], b = coil[j + 1];
const length = Math.hypot(b[0]-a[0], b[1]-a[1], b[2]-a[2]);
const steps = Math.ceil(length / .72);
for (let k = 0; k < steps; k++) {
const t = k / steps;
samples.push([
a[0] + (b[0]-a[0])*t,
a[1] + (b[1]-a[1])*t,
a[2] + (b[2]-a[2])*t,
b[0]-a[0], b[1]-a[1]
]);
}
}
samples.push([...coil[coil.length-1], -1, -4]);
// Lay down the belly first; the red scales overlap its upper edge.
for (const [x, y, z] of samples)
sphere(x, y - 1.5, z - 1.3, 2.25, "#bc802c");
for (const [x, y, z] of samples)
sphere(x, y - 1.6, z - 1.65, 1.75, "#f5bd50");
for (let i = 0; i < samples.length; i++) {
const [x, y, z] = samples[i];
const r = 3.1 + .18 * Math.sin(i * .17);
sphere(x, y, z, r, i % 9 < 3 ? "#ae2723" : "#bb3028");
if (i % 4 === 0) {
sphere(x - .9, y - 1.9, z + .75, .8, "#dd4a32");
sphere(x + 1.1, y - 1.45, z + 1.55, .7, "#d8442b");
sphere(x, y - 2.85, z - 1.2, .62, "#ffe08a");
}
if (i % 5 === 0) {
sphere(x, y, z + 2.9, 1, "#205d43");
line(x, y, z + 2.8, x - .5, y + .7, z + 4.3, .6, "#3a9460");
set(x - .5, y + .7, z + 4.3, "#83b96c");
}
}
// Gold edging and small jade ornaments on the visible coil.
for (let i = 2; i < samples.length; i += 9) {
const [x, y, z] = samples[i];
sphere(x - 2.5, y - .5, z + .2, .65, "#efab40");
sphere(x + 2.4, y - .4, z + .4, .55, "#eab448");
}
// Hinged tail with a green, flame-shaped fin.
part("tail", [35, 33, 18]);
const tail = [[35,33,18],[38,34,19],[41,35,21],[43,34,23]];
for (let j = 0; j < tail.length-1; j++) {
const a = tail[j], b = tail[j+1];
line(...a, ...b, 2.2-j*.43, j === 2 ? "#d4442d" : "#aa2824");
line(a[0],a[1]-1,a[2]-1,b[0],b[1]-1,b[2]-1, .9, "#f2bc50");
}
line(42,35,22, 45,34,27, 1, "#1b684c");
line(42,35,22, 44,37,27, 1, "#358a59");
line(42,35,22, 42,38,25, .8, "#68a86a");
line(42,35,22, 45,32,25, .8, "#e6ad46");
sphere(43,35,23, 1.3, "#edb947");
animate("tail", {type:"swing", axis:"z", speed:2.1, amplitude:.43});
// Bobbing head, with an open dark mouth beneath the upper muzzle.
part("head", [17, 17, 29]);
ellipsoid(15, 12, 31, 5.6, 5, 4.3, "#ab2524");
ellipsoid(15, 10, 32.3, 5.2, 4.3, 3.4, "#c73429");
ellipsoid(15, 6.5, 29.5, 4.3, 4, 2.3, "#c73629");
// Inside of the open mouth and its separate lower jaw.
ellipsoid(15, 5.7, 26.9, 3.6, 3.3, 1.5, "#461b25");
ellipsoid(15, 7.2, 25, 4.1, 4.5, 1.25, "#a72525");
ellipsoid(15, 6, 25.7, 3.1, 3, .55, "#e6aa48");
line(11,7,25,19,7,25,.55,"#fbd67a");
ellipsoid(15, 6.4, 26.2, 2, 1.7, .45, "#da6273");
for (const x of [12, 15, 18]) {
line(x, 4.3, 28.3, x, 4.3, 27, .45, "#fff2cf");
}
for (const x of [12, 18]) {
line(x, 5.5, 25.9, x, 5.2, 27, .5, "#fff2cf");
}
// Broad gold brows, bright eyes, and nostrils.
for (const x of [11, 19]) {
ellipsoid(x, 7.7, 33, 1.5, .8, 1.5, "#f6d57b");
sphere(x, 6.8, 33, .9, "#f9f3df");
sphere(x + (x < 15 ? .3 : -.3), 5.9, 33, .48, "#172a24");
line(x-1.6, 7.8, 34.8, x+1.2, 7.3, 35, .7, "#efaa43");
sphere(x, 3.5, 30.1, .62, "#68201e");
}
line(11, 4.2, 29, 19, 4.2, 29, .45, "#edaa47");
// Gold-tipped horns.
for (const s of [-1, 1]) {
const x = 15 + s*3.3;
line(x, 13, 34.5, x+s*1.1, 14, 38, 1.2, "#e5b150");
line(x+s*1.1, 14, 38, x+s*2, 12.5, 41, .75, "#f5d477");
sphere(x+s*2, 12.5, 41, .7, "#fff1b3");
}
// Flowing jade mane framing the face and crown.
for (let i = 0; i < 7; i++) {
const x = 11 + i*1.35;
line(x, 14, 34.5, x-1.3, 16.5, 37.5+(i%3), .8, "#24684b");
sphere(x-1.3, 16.5, 37.5+(i%3), .7, "#5da56b");
}
for (const x of [9.7, 20.3]) {
line(x, 11, 33, x+(x<15?-1.5:1.5), 14, 29, 1, "#276f4b");
line(x+(x<15?-1.5:1.5), 14, 29,
x+(x<15?-2.5:2.5), 14.5, 27, .55, "#71af6a");
}
// Long curved whiskers, finished with tiny gold tips.
for (const s of [-1, 1]) {
const x = 15+s*3.5;
line(x,5.5,28.4, x+s*3.5,3.5,27.7, .55, "#f0bd58");
line(x+s*3.5,3.5,27.7, x+s*7,4,25.2, .4, "#ffda7d");
line(x,6.3,27.7, x+s*3,5.5,25.8, .4, "#eab64e");
line(x+s*3,5.5,25.8, x+s*5,7,24.8, .3, "#ffdc83");
}
animate("head", {type:"bob", axis:"z", speed:2.2, amplitude:1});import { draw } from "./assets/voxel";
import { dragonChino } from "./assets/dragon-chino";
// En cada cuadro: parado sobre (x, y), el centro de su base.
draw(ctx, dragonChino, 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 dragon-chino
# Con las herramientas de Fogón (conector)
add_assets({ slug: "<tu-juego>", ids: ["dragon-chino"] })
# Queda en client/assets/dragon-chino.ts
# https://fogon.page/object/dragon-chino