# caravan: a mesh for the world to draw in 3D. A cargo balloon caravan: a tug airship (nose toward -y, its envelope's centre at 0) towing six cargo balloons on one cable along +y; flies, so no ground: z 0 is the tug's axis.
# caravan.mesh: magic CBMESH1, uint32 vertices, uint32 indices; per vertex 40 B: float32 pos xyz (m, z up,
#   the footprint's centre on the ground at 0), float32 normal xyz, float32 uv, uint8 rgb (display sRGB),
#   uint8 kind (0 painted, 1 metal, 2 glass, 3 lamp), uint8 texture (0 none, else a row below), 3 pad;
#   then uint32 indices, 3 per triangle. A textured face: colour and alpha from the texture, cut under 0.5.
front -y
vertices 9009
triangles 10556
bytes 487048
# moving parts. spin <file> x y z ax ay az rev_s: a propeller mesh (built round its origin, spinning about its +Y)
#   placed at x y z (m, this file's frame) with its +Y turned onto the axis ax ay az, rev_s turns a second.
# u v carry the bending (texture 0 on every face, so a reader that ignores them draws the craft at rest):
#   v = 0 static; v = c + p: channel c, p in [0, 1) the strand's phase; u: the weight along the strand, 0 at its
#   root (fixed) .. 1 at its tip. channel <c> <name> amp <m> period <s> wave <cycles along> [bulge gulp lift]:
#   with a = 2 pi (t / period - wave * u + p + P), P the instance's own phase (0 for a single craft),
#   1 hang:    x y += amp * u^1.5 * ((cos a, sin a) + 0.35 (sin (0.37 a + 2), cos (0.29 a)))
#   2 hose:    as hang, and a gulp: the point moves out along its normal by bulge * exp (-((u - (1 - g)) / 0.035)^2),
#              g = fract (t / gulp + p): a bump running from the tip (u 1) up to the root (u 0) every gulp seconds
#   3 trail:   a towed train: x += amp * u * sin a, z += amp / 3 * u * sin (1.3 a + 1)
#   4 pulse:   a bell about the Z axis: c = the contraction, 0..1 (k = fract (t / period + P): c = sin (pi/2 k / 0.35)
#              while k < 0.35, then 0.5 + 0.5 cos (pi (k - 0.35) / 0.65)); x y *= 1 - amp * c * u, z -= lift * c * u
#              (u 0 at the apex, 1 at the rim)
#   5 tendril: as hang (u along it, p its sway phase), and x y *= 1 - amp4 * c (the full pulse of channel 4: it
#              hangs from the rim)
#   6 trail line: moves as trail (its own amp period wave), a thin line (the tow cable, net and load lines)
#   7 line:    does not move: a thin line (rails, cables, ribs)
#   radius <m> on a strand's channel (1 2 5 6 7): its typical thickness, so a far strand can be drawn at least a
#   pixel wide (pushed out along its normals, and as much more transparent) instead of blinking
spin caravan_prop.mesh -8.400 -2.250 -6.100 0.0000 1.0000 0.0000 3.000
spin caravan_prop.mesh 8.400 -2.250 -6.100 0.0000 1.0000 0.0000 -3.000
channel 3 trail amp 7.0 period 16.0 wave 0.9
channel 6 trail_line amp 7.0 period 16.0 wave 0.9 radius 0.09
# hard sphere x y z r | hard capsule x0 y0 z0 x1 y1 z1 r [moves <channel> <u>]: the solid parts (hulls, envelopes,
#   gondolas, balloons and their loads, a bell) as simple shapes round them, metres, this file's frame; the world
#   keeps these out of the ship. Hoses, tentacles, arms, cables and lines are soft and left out: they may brush by.
#   moves: the shape rides that bending channel at weight u (a towed balloon swings with its train).
hard capsule 0.00 -17.50 0.00 0.00 16.00 0.00 7.30
hard capsule 0.00 12.50 0.00 0.00 22.00 0.00 10.60
hard capsule 0.00 -11.50 -9.60 0.00 2.50 -9.60 2.50
hard sphere 0.00 3.00 -10.60 1.60
hard sphere -8.40 -0.60 -6.10 3.70
hard sphere 8.40 -0.60 -6.10 3.70
hard sphere 0.00 40.00 0.56 9.52 moves 3 0.1790
hard sphere 0.00 40.00 -14.80 3.00 moves 3 0.1790
hard sphere 0.00 70.00 -1.28 10.60 moves 3 0.3265
hard sphere 0.00 70.00 -15.10 3.00 moves 3 0.3265
hard sphere 0.00 100.00 0.24 9.95 moves 3 0.4739
hard sphere 0.00 100.00 -14.65 3.40 moves 3 0.4739
hard sphere 0.00 130.00 0.15 9.09 moves 3 0.6214
hard sphere 0.00 130.00 -14.80 3.00 moves 3 0.6214
hard sphere 0.00 160.00 1.39 10.58 moves 3 0.7689
hard sphere 0.00 160.00 -14.90 3.00 moves 3 0.7689
hard sphere 0.00 190.00 -2.32 6.97 moves 3 0.9164
hard sphere 0.00 190.00 -14.90 3.00 moves 3 0.9164
hook 0.00 3.60 -10.90
train_end 207.00
