Cozy campfire · celworld
seed

Cozy campfire

campfire v1Made by APIc5
Open in Playground

v1 cost

$0.286

API, priced from the call usage.

The run, with the maths
All 1 version$0.286

Budget

c5 · 61 lines
Shapes38 / 100
Triangles6,452 / 8,000
Draw calls4 / 4
States
stoke · boil · stir
Used in
No scene yet
Lineage
Made
1asset campfire "Cozy campfire" complexity=5
2// a ring of stones round a low fire of crossed logs, a little pot hanging from a tripod over the flames.
3// readable from afar: the bright layered flame, the pot on its three legs, the fat stone ring.
4// idle: flames flicker, embers pulse, the pot sways, smoke and sparks rise.
5// stoke: the flames leap. boil: the pot rattles. stir: the spoon swirls.
6let SR = .5..0.58
7let F = .9..1.12
8let stoneC = rockGrey:3|rockWarm:2|rockCool|rockSand
9let logC = barkB:2|walnut|redwood|barkC
10let potC = cobalt:3|teal|cherry|grape
11let hot = tangerine:3|tomato
12
13// ground: an ash bed
14cyl ash h=.04 r=.66 round=.015 color=bedSoil segs=28 joint
15
16// stone ring and seats
17ball stone x8..10 on=ash ring=6 at=(SR, .08, 0) r=(.15, .1, .12) color=stoneC~ segs=10 rings=6
18cyl stump x2 on=ash ring ring0=0 at=(1.3, 0, 0) h=.3 r=.2 round=.035 color=barkA cap=honey segs=14
19
20// crossed logs
21cyl log x4 on=ash ring=8 ring0=20 at=(.3, .05, 0) roll=sel(i, 64, 74, 64, 74) h=.62 r=.065 round=.02 color=logC cap=birch segs=10
22ball ember x4 on=ash ring=20 ring0=55 at=(.2, .07, 0) r=(.07, .05, .06) color=tomato ink=glow segs=8 rings=5 joint
23
24// flames: three nested teardrops and four leaning tongues
25lathe flameA on=ash at=(0, .1, 0) h=.46*F r=.2 prof=[0:.55 .25:1 .6:.7 1:.04] color=hot ink=glow segs=12 rings=8 joint
26lathe flameB on=ash at=(0, .12, 0) h=.36*F r=.15 prof=[0:.55 .25:1 .6:.7 1:.04] color=marigold ink=glow segs=12 rings=8 joint
27lathe flameC on=ash at=(0, .14, 0) h=.25*F r=.1 prof=[0:.55 .25:1 .6:.7 1:.04] color=lemon ink=glow segs=10 rings=7 joint
28lathe tongue x4 on=ash ring=15 at=(.15, .09, 0) roll=-22 h=.3*F r=.075 prof=[0:.55 .3:1 .65:.65 1:.04] color=sel(i, tomato, tangerine, marigold, tomato) ink=glow segs=10 rings=6 joint
29
30// tripod: three legs meeting at a brass knot, a hook, the hanging pot
31rod leg x3 on=ash ring0=90 ring at=(.9, 0, 0) to=(-.9, 1.25, 0) r=.03 sides=8 color=walnut
32ball knot on=ash at=(0, 1.25, 0) r=.07 color=brass segs=10 rings=6
33rod hook on=ash at=(0, 1.25, 0) to=(0, -.29, 0) r=.02 sides=6 color=iron joint
34lathe pot on=hook at=end+(0, -.44, 0) h=.24 r=.19 prof=[0:.72 .12:.95 .6:1 .92:.96 1:.9] bands=[.86:silver] color=potC segs=20 rings=10 joint
35cyl soup on=pot at=top+(0, -.02, 0) h=.035 r=.14 color=honey segs=16 joint
36tube handle on=pot at=top pts=[-.16,-.03,0 -.14,.1,0 0,.19,0 .14,.1,0 .16,-.03,0] r=.02 smooth sides=6 detail=.7 color=iron
37rod spoon on=pot at=top+(0, -.1, 0) to=(.17, .34, .1) r=.02 sides=6 color=oak joint
38ball spoonTip on=spoon at=end r=.035 color=oak segs=8 rings=5
39
40// smoke and sparks rise
41fx smoke on=ash at=(-.28, .6, -.1) speed=.5 n=7 hz=.3
42fx sparkle on=ash at=(.12, .3, .27) speed=.7 gravity=-.2 spread=.12 n=8 hz=.7 size=.03 color=sunflower color2=tangerine
43
44// idle life
45anim flameA s sin amp=.07 hz=1.7
46anim flameB s sin amp=.09 hz=2.3 phase=.3
47anim flameC s sin amp=.1 hz=3.1 phase=.6
48anim tongue rz sin amp=9 hz=2.2 stagger=.25
49anim tongue s sin amp=.12 hz=2.7 stagger=.3
50anim ember s sin amp=.15 hz=.8 stagger=.2
51anim hook rz sin amp=1.5 hz=.4
52
53// states
54anim stoke: flameA s keys=[0:0 .3:.45 .7:.3 1:0] hz=.7
55anim stoke: flameB s keys=[0:0 .3:.5 .7:.35 1:0] hz=.7
56anim stoke: flameC s keys=[0:0 .3:.55 .7:.4 1:0] hz=.7
57anim stoke: tongue s keys=[0:0 .3:.5 .7:.3 1:0] hz=.7 stagger=.1
58anim boil: pot py bounce amp=.012 hz=5
59anim boil: pot rz sin amp=2 hz=6
60anim boil: soup s sin amp=.05 hz=5
61anim stir: spoon ry sin amp=35 hz=1.2
62