Carousel · celworld
seed

Carousel

carousel v4Hand-writtenc7
Open in PlaygroundExplain this script

How v4 was made

Hand-written

Written by hand in .cel.

Script
48 lines

Budget

c7 · 48 lines
Shapes191 / 200
Triangles14,170 / 15,000
Draw calls3 / 5
States
None: it rests
Used in
Made
1asset carousel "Carousel" complexity=7
2// an original fairground carousel: a turning deck on a plinth, a striped centre drum, a ring of
3// prancing horses on brass poles that rise and fall in turn, a scalloped striped canopy with a
4// fringe of drops and bulbs, a spire and a pennant
5let R = 2.1..2.5
6let PH = 2.1..2.4
7let NH = int(5..7.4)
8let stA = cherry:3|cobalt|teal|grape|bottle
9let stB = white:3|cream|sunflower
10let deckC = cream:2|white|peach
11let metal = brass:3|silver
12
13// the plinth and the turning deck
14cyl plinth h=.16 r=R+.14 round=.04 color=warmstone segs=28 surface=stone
15cyl deck on=plinth at=(0, .16, 0) h=.12 r=R round=.03 bands=[.55:deckC] color=stA segs=28 joint surface=planks
16cyl drum on=deck at=(0, .12, 0) h=PH r=.42 stripes=[stA stB] panels=8 color=stA segs=16
17cyl drumcap on=drum at=(0, PH*.82, 0) h=.08 r=.5 color=metal segs=16 surface=metal
18
19// the canopy: a striped band with drops and bulbs, a scalloped roof, a spire with a pennant
20cyl band on=drum at=(0, PH, 0) h=.34 r=R+.18 stripes=[stB stA] panels=2*NH*2 cap=stB color=stB segs=36
21ball drop x=2*NH*2 on=band ring at=(R+.16, 0, 0) r=(.05, .13, R*.12) color=sel(i - 2*floor(i/2), stA, stB) segs=6 rings=4
22ball bulb x=2*NH on=band ring ring0=180/(2*NH) at=(R+.19, .17, 0) r=.035 color=glow ink=glow segs=6 rings=4
23cone roof on=band at=(0, .34, 0) h=1.1 r=R+.32 r2=.08 stripes=[stA stB] panels=2*NH*2 scallop=.07 color=stA segs=40 surface=fabric
24cyl spire on=roof at=(0, 1.05, 0) h=.32 r=.045 color=metal segs=8 surface=metal
25ball knob on=spire at=end r=.08 color=metal segs=10 rings=6 surface=metal
26slab pennant on=spire at=(.04, .14, 0) pts=[0,0 .5,.09 0,.18] t=.02 color=stB edge=stA surface=fabric
27
28// the horses, one per pole
29rod pole x=NH on=deck ring at=(R*.72, .12, 0) to=(0, PH, 0) r=.035 sides=8 color=metal surface=metal
30ball horse x=NH on=deck ring at=(R*.72, 1.05, 0) rot=(0, 180, 0) r=(.17, .2, .38) color=white:3|cream|sky|pink|lilac|mint|sunflower|walnut:.6 segs=14 rings=9 joint
31limb neck on=horse at=(0, .48, .4) rot=(25, 0, 0) len=.38 r=(.075, .105) color=parent.color segs=8
32ball head on=horse at=(0, .52, .52) rot=(24, 0, 0) r=(.09, .1, .19) color=parent.color segs=12 rings=7
33face look on=head eyes=dot mouth=none size=.24 spacing=62 eyeY=16 detail=.5
34cone ear on=head at=(0, .08, -.08) mirror rot=(-12, 0, -14) h=.09 r=.035 color=parent.color segs=5
35tube mane on=horse pts=[0,.62,.36 0,.48,.28 0,.33,.2 0,.2,.12] r=(.06, .045) smooth color=sel(parent.i, sunflower, cherry, cobalt, grape, lime, pink, teal, tangerine) sides=6 detail=.5
36tube tail on=horse at=(0, .08, -.36) pts=[0,0,0 0,-.02,-.14 0,-.2,-.24 0,-.34,-.22] r=(.06, .025) smooth color=sel(parent.i, sunflower, cherry, cobalt, grape, lime, pink, teal, tangerine) sides=6 detail=.5
37ball saddle on=horse at=(0, .12, -.03) r=(.2, .1, .17) half color=sel(parent.i, cobalt, teal, cherry, sunflower, grape, cherry, cobalt, teal) segs=12 rings=4
38rod fleg on=horse at=(.08, -.06, .24) mirror to=(0, -.18, .26) r=(.045, .035) sides=6 color=parent.color
39rod fshin on=fleg at=end to=(0, -.2, -.04) r=(.035, .03) sides=6 color=parent.color
40rod bleg on=horse at=(.08, -.1, -.24) mirror to=(0, -.38, -.16) r=(.05, .035) sides=6 color=parent.color
41ball hoof on=fshin at=end r=.04 color=metal segs=5 rings=3 surface=metal
42ball bhoof on=bleg at=end r=.04 color=metal segs=5 rings=3 surface=metal
43
44// a rider astride every saddle, facing the head: they rise and fall with the horse
45spot rider on=horse at=(0, .2, -.04) use=saddle
46
47anim deck ry spin hz=.05
48anim horse py sin amp=.12 hz=.4 stagger=.37
49