sourceextensions/blender/demos/NeonCity.xtl
1⍝│ NeonCity.xtl -- a city at night after rain, worked out as arrays and
2⍝│ ray-traced (Cycles.xtl): an avenue running north between two walls
3⍝│ of towers, six lots deep on each side, every lot's tower a few rows
4⍝│ of a table -- a body, a narrower tier, sometimes a spire -- with a
5⍝│ height, a footprint and a skin of its own from a hash of its number;
6⍝│ screens on the walls that face the avenue, bands of neon, signs,
7⍝│ lamps, steam, bridges across, cars on the ground and in the air, and
8⍝│ a camera that comes down from the skyline to the puddles. Nothing is
9⍝│ drawn by hand and nothing is loaded: another seed is another
10⍝│ city (nc:c_ity). Shared by the demo (demos/city.xtl: stills), its
11⍝│ preview and film, and its test.
12⍝│ Import: "nc:" u_se< "NeonCity"
13
14"cy:" u̲se< "Cycles"
15
16⍝━━ Numbers
17
18⍝│ nc:seed: the film's city: every random choice is a hash of the seed
19⍝│ and of the thing's own number, so the same seed is the same city and
20⍝│ another seed another
21ˡseed ← 7
22
23⍝│ nc:seconds: the film's length
24ˡseconds ← 15.0
25
26⍝│ nc:media: where the film finds the screens' pictures, from the
27⍝│ blender extension's directory (where its demos run)
28ˡmedia ← "../three/web/static/media"
29
30⍝ k vectors of one length, joined end to end, as a table of k columns
31ʰc̲ols ← { (k, v) z → 2 1 t̲ranspose (k c̲at (t̲ally v) d̲iv k) r̲eshape v }
32
33⍝│ (numbers, salt, seed) nc:r_and 0: a number from 0 to 1 for each whole
34⍝│ number, the same every time: a hash of it, the salt (which choice
35⍝│ this is) and the seed, in whole numbers, so every machine agrees
36⍝│ >> "nc:" u_se< "NeonCity"
37⍝│ >> s_hape (0 1 2 3, 1, 7) nc:r_and 0
38⍝│ 4
39ˡr̲and ← { (i, salt, seed) z →
40 a ← (i + 17) × 7919 + (salt + 13 × seed) × 104729
41 b ← i + 31 + salt
42 (f̲loat ((a m̲od 65521) × b m̲od 65521) m̲od 65521) ÷ 65521.0
43}
44
45⍝ boxes standing square: middles x y z and sizes w d h (vectors) as the
46⍝ rows cy:b_oxes takes
47ʰb̲ox ← { (x, y, e, w, d, h) z → (7, x c̲at y c̲at e c̲at w c̲at d c̲at h c̲at 0.0 × x) ʰc̲ols 0 }
48
49⍝ n copies of a number
50ʰf̲ill ← { (n, x) → n r̲eshape f̲loat x }
51
52⍝━━ The lots
53
54⍝ lots: columns back from the avenue and rows along it, on each side
55cols ← 6
56rows ← 20
57per ← cols × rows
58lots ← 2 × per
59⍝ each lot's number from 0, its side (-1 west, 1 east), column and row
60id ← (r̲ange lots) − 1
61side ← (f̲loat 2 × id d̲iv per) − 1.0
62col ← (id m̲od per) d̲iv rows
63row ← (id m̲od per) m̲od rows
64⍝ a lot is 17 by 19; a cross street 12 wide after every second lot; the
65⍝ avenue 18 wide with 2 of sidewalk each side
66lx ← side × 19.5 + (17.0 × f̲loat col) + 12.0 × f̲loat col d̲iv 2
67ly ← -234.5 + (19.0 × f̲loat row) + 12.0 × f̲loat row d̲iv 2
68
69⍝│ nc:l_ots seed: the lots as a table, a row each: x y (its middle),
70⍝│ the tower's height, its width and depth, its skin (0 to 2), whether
71⍝│ it has a tier and a spire (1 or 0), how far back from the avenue it
72⍝│ is (0 the first), and where its body ends (the tier begins there).
73⍝│ Heights: most low, a few very tall; taller by the avenue, and never
74⍝│ under 45 on it, so the avenue is a canyon; a tower over 60 has a
75⍝│ narrower tier, and some of those a spire.
76⍝│ >> "nc:" u_se< "NeonCity"
77⍝│ >> s_hape nc:l_ots 7
78⍝│ 240 10
79ˡl̲ots ← { seed →
80 u ← (id, 1, seed) ˡr̲and 0
81 rough ← (((26.0 + 150.0 × u × u) × 1.25 − 0.09 × f̲loat col) m̲ax
82 45.0 × f̲loat 1 × col = 0)
83 wide ← 15.5 − 3.0 × (id, 2, seed) ˡr̲and 0
84 deep ← 17.5 − 3.0 × (id, 3, seed) ˡr̲and 0
85 skin ← f̲loat f̲loor 3.0 × (id, 4, seed) ˡr̲and 0
86 tiered ← f̲loat 1 × rough > 60.0
87 body ← rough × (1.0 − tiered) + tiered × 0.55 + 0.3 × (id, 5, seed) ˡr̲and 0
88 spired ← tiered × f̲loat 1 × ((id, 6, seed) ˡr̲and 0) > 0.7
89 (10, lx c̲at ly c̲at rough c̲at wide c̲at deep c̲at skin c̲at tiered c̲at spired c̲at (f̲loat col) c̲at body) ʰc̲ols 0
90}
91
92⍝│ (lots, k) nc:t_owers 0: the boxes of every tower wearing skin k (0 to
93⍝│ 2): bodies, then tiers, then spires
94⍝│ >> "nc:" u_se< "NeonCity"
95⍝│ >> 2 s_elect s_hape (nc:l_ots 7, 0) nc:t_owers 0
96⍝│ 7
97ˡt̲owers ← { (t, k) z →
98 x ← 1 s̲elect₂ t
99 y ← 2 s̲elect₂ t
100 rough ← 3 s̲elect₂ t
101 wide ← 4 s̲elect₂ t
102 deep ← 5 s̲elect₂ t
103 body ← 10 s̲elect₂ t
104 worn ← (6 s̲elect₂ t) = f̲loat k
105 tiered ← worn ∧ (7 s̲elect₂ t) > 0.5
106 spired ← worn ∧ (8 s̲elect₂ t) > 0.5
107 bodies ← worn r̲eplicate₁ (x, y, body ÷ 2.0, wide, deep, body) ʰb̲ox 0
108 tiers ← tiered r̲eplicate₁ (x, y, body + (rough − body) ÷ 2.0, 0.72 × wide, 0.72 × deep, rough − body) ʰb̲ox 0
109 bodies c̲at₁ tiers c̲at₁ spired r̲eplicate₁ (x, y, rough × 1.14, 0.34 × wide, 0.34 × deep, rough × 0.28) ʰb̲ox 0
110}
111
112⍝━━ On the towers
113
114⍝│ (lots, seed) nc:r_oofs 0: what stands on the roofs, as two tables of
115⍝│ boxes: a machine on every roof and an aerial on some; and a beacon
116⍝│ on every aerial and every spire
117ˡr̲oofs ← { (t, seed) z →
118 x ← 1 s̲elect₂ t
119 y ← 2 s̲elect₂ t
120 rough ← 3 s̲elect₂ t
121 wide ← 4 s̲elect₂ t
122 deep ← 5 s̲elect₂ t
123 spired ← 8 s̲elect₂ t
124 units ← (x + 0.2 × wide, y − 0.15 × deep, rough + 0.8, ʰf̲ill (lots, 3.2), ʰf̲ill (lots, 2.2), ʰf̲ill (lots, 1.6)) ʰb̲ox 0
125 aerial ← (1.0 − spired) × f̲loat 1 × ((id, 7, seed) ˡr̲and 0) > 0.6
126 mast ← 8.0 + 12.0 × (id, 8, seed) ˡr̲and 0
127 masts ← (aerial > 0.5) r̲eplicate₁ (x − 0.2 × wide, y + 0.2 × deep, rough + mast ÷ 2.0, ʰf̲ill (lots, 0.25), ʰf̲ill (lots, 0.25), mast) ʰb̲ox 0
128 tip ← rough + (mast × aerial) + (rough × 0.28) × spired
129 lit ← (aerial + spired) > 0.5
130 beacons ← lit r̲eplicate₁ (x − (0.2 × wide) × aerial, y + (0.2 × deep) × aerial, tip + 0.3, ʰf̲ill (lots, 0.7), ʰf̲ill (lots, 0.7), ʰf̲ill (lots, 0.7)) ʰb̲ox 0
131 (units c̲at₁ masts, beacons)
132}
133
134⍝│ (lots, seed, k) nc:b_ands 0: the neon bands of color k (0 to 2):
135⍝│ round the foot of the towers by the avenue, and under the tier of
136⍝│ the tall ones
137ˡb̲ands ← { (t, seed, k) z →
138 x ← 1 s̲elect₂ t
139 y ← 2 s̲elect₂ t
140 wide ← 4 s̲elect₂ t
141 deep ← 5 s̲elect₂ t
142 body ← 10 s̲elect₂ t
143 foot ← (x, y, ʰf̲ill (lots, 5.0), wide + 0.4, deep + 0.4, ʰf̲ill (lots, 0.3)) ʰb̲ox 0
144 ledge ← (x, y, body + 0.15, wide + 0.3, deep + 0.3, ʰf̲ill (lots, 0.3)) ʰb̲ox 0
145 low ← (col < 2) ∧ k = f̲loor 3.0 × (id, 9, seed) ˡr̲and 0
146 up ← ((7 s̲elect₂ t) > 0.5) ∧ (col < 3) ∧ k = f̲loor 3.0 × (id, 10, seed) ˡr̲and 0
147 (low r̲eplicate₁ foot) c̲at₁ up r̲eplicate₁ ledge
148}
149
150⍝ a screen's height for its width, by kind: 0 for the four abstract
151⍝ kinds (any shape); a slide show's or a video's own shape for the rest
152ratio ← 0.0 0.0 0.0 0.0 1.0 0.625 0.5625 0.5625 0.5625 0.5625 0.5625
153
154⍝│ (lots, seed, k) nc:s_creens 0: the screens of kind k on the walls
155⍝│ facing the avenue, on most of the first towers: 0 bars, 1 rings, 2
156⍝│ rain, 3 tiles (pictures worked out from the time, any shape); 4 and
157⍝│ 5 slide shows, 6 to 10 videos, each the shape of its pictures
158ˡs̲creens ← { (t, seed, k) z →
159 x ← 1 s̲elect₂ t
160 y ← 2 s̲elect₂ t
161 wide ← 4 s̲elect₂ t
162 body ← 10 s̲elect₂ t
163 shown ← (col = 0) ∧ (((id, 11, seed) ˡr̲and 0) > 0.25) ∧ k = f̲loor 11.0 × (id, 20, seed) ˡr̲and 0
164 sw ← 5.0 + 7.0 × (id, 12, seed) ˡr̲and 0
165 r ← (k + 1) s̲elect ratio
166 sh ← ((5.0 + 11.0 × (id, 13, seed) ˡr̲and 0) × f̲loat 1 × r = 0.0) + sw × r
167 sz ← 8.0 + ((body − 16.0) m̲in 34.0) × (id, 14, seed) ˡr̲and 0
168 shown r̲eplicate₁ (x − side × 0.3 + wide ÷ 2.0, y, sz + sh ÷ 2.0, ʰf̲ill (lots, 0.4), sw, sh) ʰb̲ox 0
169}
170
171⍝━━ The street
172
173⍝ blocks of two lots by two, each a slab of sidewalk
174blocks ← (cols × rows) d̲iv 2
175bid ← (r̲ange blocks) − 1
176bside ← (f̲loat 2 × bid d̲iv blocks d̲iv 2) − 1.0
177bcol ← (bid m̲od blocks d̲iv 2) d̲iv rows d̲iv 2
178brow ← (bid m̲od blocks d̲iv 2) m̲od rows d̲iv 2
179bx ← bside × 28.0 + 46.0 × f̲loat bcol
180by ← -225.0 + 50.0 × f̲loat brow
181slabs ← (bx, by, ʰf̲ill (blocks, 0.15), ʰf̲ill (blocks, 37.0), ʰf̲ill (blocks, 41.0), ʰf̲ill (blocks, 0.3)) ʰb̲ox 0
182
183⍝ the dashes down the middle of the avenue
184dashes ← 62
185dy ← -244.0 + 8.0 × f̲loat (r̲ange dashes) − 1
186paint ← (ʰf̲ill (dashes, 0.0), dy, ʰf̲ill (dashes, 0.012), ʰf̲ill (dashes, 0.18), ʰf̲ill (dashes, 3.0), ʰf̲ill (dashes, 0.02)) ʰb̲ox 0
187
188⍝ street lamps down both sides: a post, an arm, a light
189posts ← 32
190pside ← (f̲loat 2 × ((r̲ange posts) − 1) m̲od 2) − 1.0
191py ← -232.0 + 30.0 × f̲loat ((r̲ange posts) − 1) d̲iv 2
192stems ← (pside × 9.7, py, ʰf̲ill (posts, 3.6), ʰf̲ill (posts, 0.18), ʰf̲ill (posts, 0.18), ʰf̲ill (posts, 7.2)) ʰb̲ox 0
193arms ← (pside × 8.9, py, ʰf̲ill (posts, 7.2), ʰf̲ill (posts, 1.8), ʰf̲ill (posts, 0.2), ʰf̲ill (posts, 0.14)) ʰb̲ox 0
194bulbs ← (pside × 8.4, py, ʰf̲ill (posts, 7.1), ʰf̲ill (posts, 0.9), ʰf̲ill (posts, 0.22), ʰf̲ill (posts, 0.06)) ʰb̲ox 0
195glows ← (8, (pside × 8.4) c̲at py c̲at (ʰf̲ill (posts, 6.8)) c̲at (ʰf̲ill (posts, 255)) c̲at (ʰf̲ill (posts, 190)) c̲at (ʰf̲ill (posts, 120)) c̲at (ʰf̲ill (posts, 450)) c̲at ʰf̲ill (posts, 0.15)) ʰc̲ols 0
196
197⍝ bridges across the avenue, lit rooms inside, a strip of neon under
198⍝ each; and a gate at the north end carrying the great screen
199spans ← 2 7 r̲eshape 0.0 -28.0 15.5 27.0 5.0 3.4 0.0 0.0 97.0 19.0 27.0 5.0 3.4 0.0
200strips ← 2 7 r̲eshape 0.0 -28.0 13.7 24.0 0.3 0.12 0.0 0.0 97.0 17.2 24.0 0.3 0.12 0.0
201pylons ← 2 7 r̲eshape -31.0 252.0 36.0 6.0 6.0 72.0 0.0 31.0 252.0 36.0 6.0 6.0 72.0 0.0
202great ← 1 7 r̲eshape 0.0 251.0 44.0 56.0 0.5 31.5 0.0
203
204⍝ steam from the street, a side and then the other
205vents ← 7
206vy ← -210.0 + 68.0 × f̲loat (r̲ange vents) − 1
207vx ← 7.2 × (f̲loat 2 × ((r̲ange vents) − 1) m̲od 2) − 1.0
208plumes ← (6, vx c̲at vy c̲at (ʰf̲ill (vents, 5.5)) c̲at (ʰf̲ill (vents, 5.0)) c̲at (ʰf̲ill (vents, 5.0)) c̲at ʰf̲ill (vents, 11.0)) ʰc̲ols 0
209
210⍝━━ Traffic
211
212⍝ cars on the avenue: four lanes, eight to a lane, north on the east
213⍝ side; each goes at its own speed the whole film
214cars ← 32
215cid ← (r̲ange cars) − 1
216lane ← cid m̲od 4
217north ← (f̲loat 2 × lane d̲iv 2) − 1.0
218cx ← north × 2.6 + 3.6 × f̲loat lane m̲od 2
219
220⍝│ nc:c_ars seed: the cars on the avenue, a row each: from x y z to x y
221⍝│ z in the film (what cy:f_leet takes)
222⍝│ >> "nc:" u_se< "NeonCity"
223⍝│ >> s_hape nc:c_ars 7
224⍝│ 32 6
225ˡc̲ars ← { seed →
226 y ← north × -250.0 + (64.0 × f̲loat cid d̲iv 4) + 30.0 × (cid, 21, seed) ˡr̲and 0
227 run ← north × ˡseconds × 9.0 + 9.0 × (cid, 22, seed) ˡr̲and 0
228 (6, cx c̲at y c̲at (ʰf̲ill (cars, 0.0)) c̲at cx c̲at (y + run) c̲at ʰf̲ill (cars, 0.0)) ʰc̲ols 0
229}
230
231⍝ fliers along the cross streets, a level each street, a way each
232⍝ level; and two streams high over the avenue
233fliers ← 27
234fid ← (r̲ange fliers) − 1
235street ← fid m̲od 9
236east ← (f̲loat 2 × street m̲od 2) − 1.0
237fy ← -200.0 + 50.0 × f̲loat street
238high2 ← 10
239hid ← (r̲ange high2) − 1
240hn ← (f̲loat 2 × hid m̲od 2) − 1.0
241hz ← 62.0 + 9.0 × f̲loat hid m̲od 2
242
243⍝│ nc:f_liers seed: the fliers, rows as nc:c_ars: along the cross
244⍝│ streets, then over the avenue
245⍝│ >> "nc:" u_se< "NeonCity"
246⍝│ >> s_hape nc:f_liers 7
247⍝│ 37 6
248ˡf̲liers ← { seed →
249 fz ← 26.0 + (11.0 × f̲loat street m̲od 3) + 4.0 × (fid, 23, seed) ˡr̲and 0
250 x ← east × -330.0 + (150.0 × f̲loat fid d̲iv 9) + 60.0 × (fid, 24, seed) ˡr̲and 0
251 run ← east × ˡseconds × 22.0 + 16.0 × (fid, 25, seed) ˡr̲and 0
252 y ← hn × -300.0 + (110.0 × f̲loat hid d̲iv 2) + 40.0 × (hid, 26, seed) ˡr̲and 0
253 across ← (6, x c̲at fy c̲at fz c̲at (x + run) c̲at fy c̲at fz) ʰc̲ols 0
254 across c̲at₁ (6, (hn × 5.5) c̲at y c̲at hz c̲at (hn × 5.5) c̲at (y + hn × ˡseconds × 30.0) c̲at hz) ʰc̲ols 0
255}
256
257⍝━━ The camera
258
259⍝│ nc:times: the times of the flight (cy:f_ly), with nc:eyes and
260⍝│ nc:aims: from over the
261⍝│ skyline at the south end, down between the towers, under the first
262⍝│ bridge to the height of a car's roof, along the puddles, and up a
263⍝│ little to the great screen at the north end
264ˡtimes ← 0.0 3.0 6.0 9.0 12.0 15.0
265⍝│ nc:eyes: where the camera is at each of nc:times (6 by 3)
266ˡeyes ← 6 3 r̲eshape 0.0 -330.0 150.0 0.0 -255.0 78.0 -2.0 -170.0 26.0 1.6 -80.0 5.0 -1.2 20.0 2.3 0.0 120.0 5.5
267⍝│ nc:aims: what it looks at then (6 by 3)
268ˡaims ← 6 3 r̲eshape 0.0 -150.0 40.0 0.0 -90.0 26.0 0.0 -40.0 10.0 0.0 30.0 5.0 0.0 130.0 8.0 0.0 250.0 34.0
269
270⍝━━ The scene
271
272⍝ the materials
273ʰs̲kins ← { where →
274 ⍝ the pictures: two slide shows, five videos, and the great screen's
275 (((("skin 0", 60 62 70, 255 220 170, 180 230 255, 1.6 3.2, 0.3, 2.5) ᶜʸf̲acade 0) c̲at (("skin 1", 80 60 60, 255 120 180, 255 230 160, 2.4 3.0, 0.2, 2.5) ᶜʸf̲acade 0)) c̲at
276 ((("skin 2", 40 50 60, 120 255 230, 200 160 255, 1.2 3.6, 0.4, 2.0) ᶜʸf̲acade 0)) c̲at
277 ((("street", 62 62 65, 0.45, 5.0, 0.25) ᶜʸw̲et 0) c̲at (("walk", 70 70 74, 0.55, 0.0) ᶜʸs̲urface 0)) c̲at
278 ((("dark", 46 46 50, 0.45, 0.7) ᶜʸs̲urface 0) c̲at (("paint", 200 200 190, 0.6, 0.0) ᶜʸs̲urface 0) c̲at (("shell", 30 34 44, 0.25, 0.9) ᶜʸs̲urface 0)) c̲at
279 ((("neon 0", 255 13 102, 8.0) ᶜʸn̲eon 0) c̲at (("neon 1", 13 204 255, 8.0) ᶜʸn̲eon 0) c̲at (("neon 2", 255 128 13, 8.0) ᶜʸn̲eon 0)) c̲at
280 ((("warm", 255 190 120, 20.0) ᶜʸn̲eon 0) c̲at (("head", 255 245 220, 40.0) ᶜʸn̲eon 0) c̲at (("tail", 255 5 5, 40.0) ᶜʸn̲eon 0) c̲at (("beacon", 255 20 10, 30.0) ᶜʸn̲eon 0)) c̲at
281 ((("screen 0", "bars", 255 26 128, 26 230 255, 0.5, 5.0) ᶜʸs̲creen 0) c̲at (("screen 1", "rings", 255 153 26, 77 26 255, 0.4, 5.0) ᶜʸs̲creen 0)) c̲at
282 ((("screen 2", "rain", 26 255 102, 204 255 230, 0.6, 6.0) ᶜʸs̲creen 0) c̲at (("screen 3", "tiles", 255 26 51, 26 102 255, 2.0, 5.0) ᶜʸs̲creen 0)) c̲at
283 ((ᶜʸm̲edia where) c̲at (("screen 4", "art", 16, 4.0, 1.6) ᶜʸs̲lides 0) c̲at (("screen 5", "xetal", 12, 4.0, 1.6) ᶜʸs̲lides 0)) c̲at
284 ((("screen 6", "voxels.webm", 1.6) ᶜʸr̲eel 0) c̲at (("screen 7", "rubik.webm", 1.6) ᶜʸr̲eel 0) c̲at (("screen 8", "life.webm", 1.6) ᶜʸr̲eel 0)) c̲at
285 ((("screen 9", "stone.webm", 1.6) ᶜʸr̲eel 0) c̲at (("screen 10", "cosy.webm", 1.6) ᶜʸr̲eel 0)) c̲at
286 (("great", "matmul.webm", 1.8) ᶜʸr̲eel 0))
287}
288
289⍝ what stands: towers, what is on them, the street's furniture
290ʰb̲uilt ← { seed →
291 lt ← ˡl̲ots seed
292 (units, beacons) ← (lt, seed) ˡr̲oofs 0
293 (((("ground", 1 7 r̲eshape 0.0 0.0 -0.5 1400.0 1400.0 1.0 0.0, "street") ᶜʸb̲oxes 0) c̲at (("walks", slabs, "walk") ᶜʸb̲oxes 0) c̲at (("dashes", paint, "paint") ᶜʸb̲oxes 0)) c̲at
294 ((("towers 0", (lt, 0) ˡt̲owers 0, "skin 0") ᶜʸb̲oxes 0) c̲at (("towers 1", (lt, 1) ˡt̲owers 0, "skin 1") ᶜʸb̲oxes 0) c̲at (("towers 2", (lt, 2) ˡt̲owers 0, "skin 2") ᶜʸb̲oxes 0)) c̲at
295 ((("units", units, "dark") ᶜʸb̲oxes 0) c̲at (("beacons", beacons, "beacon") ᶜʸb̲oxes 0)) c̲at
296 ((("bands 0", (lt, seed, 0) ˡb̲ands 0, "neon 0") ᶜʸb̲oxes 0) c̲at (("bands 1", (lt, seed, 1) ˡb̲ands 0, "neon 1") ᶜʸb̲oxes 0) c̲at (("bands 2", (lt, seed, 2) ˡb̲ands 0, "neon 2") ᶜʸb̲oxes 0)) c̲at
297 ((("screens 0", (lt, seed, 0) ˡs̲creens 0, "screen 0") ᶜʸb̲oxes 0) c̲at (("screens 1", (lt, seed, 1) ˡs̲creens 0, "screen 1") ᶜʸb̲oxes 0)) c̲at
298 ((("screens 2", (lt, seed, 2) ˡs̲creens 0, "screen 2") ᶜʸb̲oxes 0) c̲at (("screens 3", (lt, seed, 3) ˡs̲creens 0, "screen 3") ᶜʸb̲oxes 0)) c̲at
299 ((("screens 4", (lt, seed, 4) ˡs̲creens 0, "screen 4") ᶜʸb̲oxes 0) c̲at (("screens 5", (lt, seed, 5) ˡs̲creens 0, "screen 5") ᶜʸb̲oxes 0)) c̲at
300 ((("screens 6", (lt, seed, 6) ˡs̲creens 0, "screen 6") ᶜʸb̲oxes 0) c̲at (("screens 7", (lt, seed, 7) ˡs̲creens 0, "screen 7") ᶜʸb̲oxes 0)) c̲at
301 ((("screens 8", (lt, seed, 8) ˡs̲creens 0, "screen 8") ᶜʸb̲oxes 0) c̲at (("screens 9", (lt, seed, 9) ˡs̲creens 0, "screen 9") ᶜʸb̲oxes 0)) c̲at
302 ((("screens 10", (lt, seed, 10) ˡs̲creens 0, "screen 10") ᶜʸb̲oxes 0)) c̲at
303 ((("posts", stems c̲at₁ arms, "dark") ᶜʸb̲oxes 0) c̲at (("bulbs", bulbs, "warm") ᶜʸb̲oxes 0) c̲at (("lamps", glows) ᶜʸl̲amps 0)) c̲at
304 ((("spans", spans, "skin 0") ᶜʸb̲oxes 0) c̲at (("strips", strips, "neon 1") ᶜʸb̲oxes 0)) c̲at
305 (("pylons", pylons, "dark") ᶜʸb̲oxes 0) c̲at (("great", great, "great") ᶜʸb̲oxes 0))
306}
307
308⍝ the signs that hang over the sidewalks, read from the south
309ʰs̲igns ← { z →
310 (((("sign 1", "X_eTaL", -10.4 -150.0 34.0, 2.6, 0, 1, "neon 0") ᶜʸs̲ign 0) c̲at (("sign 2", "ARRAYS", 10.4 -95.0 30.0, 2.4, 0, 1, "neon 1") ᶜʸs̲ign 0)) c̲at
311 ((("sign 3", "RHO", -10.4 -52.0 20.0, 2.2, 0, 1, "neon 2") ᶜʸs̲ign 0) c̲at (("sign 4", "OPEN 24H", 0.0 -30.8 15.5, 1.6, 0, 0, "neon 0") ᶜʸs̲ign 0)) c̲at
312 ((("sign 5", "IOTA", 10.4 14.0 22.0, 2.2, 0, 1, "neon 0") ᶜʸs̲ign 0) c̲at (("sign 6", "NOODLES", -10.4 52.0 24.0, 2.0, 0, 1, "neon 1") ᶜʸs̲ign 0)) c̲at
313 (("sign 7", "KERNEL", 0.0 94.2 19.0, 1.6, 0, 0, "neon 2") ᶜʸs̲ign 0) c̲at (("sign 8", "HOTEL", 10.4 150.0 30.0, 2.6, 0, 1, "neon 2") ᶜʸs̲ign 0))
314}
315
316⍝ what moves: a car and a flier, made once, and their fleets
317ʰt̲raffic ← { seed →
318 (((ᶜʸm̲odel "car") c̲at (("car body", 2 7 r̲eshape 0.0 0.0 0.55 4.4 1.9 0.6 0.0 -0.3 0.0 1.1 2.4 1.7 0.55 0.0, "shell", "car") ᶜʸp̲arts 0)) c̲at
319 ((("car head", 2 7 r̲eshape 2.2 0.6 0.6 0.06 0.35 0.15 0.0 2.2 -0.6 0.6 0.06 0.35 0.15 0.0, "head", "car") ᶜʸp̲arts 0)) c̲at
320 ((("car tail", 1 7 r̲eshape -2.2 0.0 0.72 0.06 1.6 0.1 0.0, "tail", "car") ᶜʸp̲arts 0)) c̲at
321 ((ᶜʸm̲odel "flier") c̲at (("flier body", 3 7 r̲eshape 0.0 0.0 0.0 5.2 2.2 0.7 0.0 -0.4 0.0 0.55 2.6 1.9 0.5 0.0 -2.3 0.0 0.7 0.9 2.8 0.08 0.0, "shell", "flier") ᶜʸp̲arts 0)) c̲at
322 ((("flier head", 1 7 r̲eshape 2.6 0.0 0.0 0.06 1.5 0.12 0.0, "head", "flier") ᶜʸp̲arts 0) c̲at (("flier tail", 1 7 r̲eshape -2.6 0.0 0.1 0.06 1.9 0.12 0.0, "tail", "flier") ᶜʸp̲arts 0)) c̲at
323 ((("flier under", 1 7 r̲eshape 0.0 0.0 -0.4 4.0 1.6 0.05 0.0, "neon 1", "flier") ᶜʸp̲arts 0)) c̲at
324 (("cars", "car", ˡc̲ars seed) ᶜʸf̲leet 0) c̲at (("fliers", "flier", ˡf̲liers seed) ᶜʸf̲leet 0))
325}
326
327⍝│ (seed, media, width, height, fps, samples, device) nc:c_ity 0: the
328⍝│ city of that seed as the calls of a player, without the player;
329⍝│ media is the folder of the screens' pictures (slides and videos:
330⍝│ the three extension's web/static/media), from where the player
331⍝│ runs. The picture
332⍝│ (cy:s_tage) for nc:seconds, the sky, the materials, the city, its
333⍝│ signs and traffic, haze over it all, steam, the camera's flight and
334⍝│ the report. Blender's player is cy:head (nc:s_cene); a player in
335⍝│ another renderer that defines the same functions draws the same
336⍝│ city from the same text (Three.xtl's, in a browser).
337ˡc̲ity ← { (seed, where, w, h, fps, samples, device) z →
338 ((((w, h, fps, ˡseconds, samples, device) ᶜʸs̲tage 0) c̲at (("AgX - Punchy", 0.0, 0.5) ᶜʸl̲ook 0) c̲at ((30 14 40, 2 3 8, 1.0) ᶜʸs̲ky 0)) c̲at
339 ((ʰs̲kins where) c̲at (ʰb̲uilt seed) c̲at (ʰs̲igns 0) c̲at ʰt̲raffic seed) c̲at
340 ((("haze", 1 6 r̲eshape 0.0 0.0 110.0 1300.0 1300.0 220.0, 150 165 255, 0.0012, 0.5) ᶜʸf̲og 0) c̲at (("vent", plumes, 255 255 255, 1.2, 1.5) ᶜʸs̲team 0)) c̲at
341 ((ˡtimes, ˡeyes, ˡaims, 24, 2.0) ᶜʸf̲ly 0) c̲at ((1.0, 0.6, 0.6) ᶜʸb̲loom 0) c̲at ᶜʸreport)
342}
343
344⍝│ (width, height, fps, samples, device) nc:s_cene 0: the whole script
345⍝│ Blender runs but its rendering, for the film's city (nc:seed):
346⍝│ cy:head, then nc:c_ity. What to render is the caller's, added after:
347⍝│ cy:s_till, or cy:f_rames and cy:e_ncode.
348ˡs̲cene ← { (w, h, fps, samples, device) z → ᶜʸhead c̲at (ˡseed, ˡmedia, w, h, fps, samples, device) ˡc̲ity 0 }