-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
332 lines (276 loc) · 12.4 KB
/
index.html
File metadata and controls
332 lines (276 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Programming Generative Art — Web Directions Code 2018</title>
<meta name="author" content="Xavier Ho">
<meta name="description" content="Programming generative art, also known as creative coding, is often a trial-and-error process, combining creativity and logic to present something aesthetic. However, creative coding has a high barrier to entry due to the breadth of knowledge and coding skills required. This talk aims to lower that barrier for you to take home and practice creative coding.
In this talk, you will learn about algorithms and techniques for generative art using Javascript. First, shepherding random numbers to simulate the universality of nature patterns that appear in plants, rocks, sand, and smoke. Next, using L-system formal grammar to create a seemingly infinite, but well-structured, series of graphics. Lastly, integrating your creativity to be used in your own projects.
For you to get the most out of this talk, you should be comfortable working with Javascript. Although I will introduce some theory, background in mathematics and formal theory is not required to attend.">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/spaxe-dark.css">
<link rel="stylesheet" href="css/custom.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-state="cover-slide">
<div>
<h2 style="margin-left: 0; margin-right: 0">Programming Generative Art</h2>
<p><a href="https://twitter.com/Xavier_Ho">@Xavier_Ho</a></p>
<p>Front-End Development | Data61</p>
</div>
<div id="cover-slide"></div>
</section>
<section data-background-image="https://static1.squarespace.com/static/51392274e4b0f86e34bbf68e/51392274e4b0f86e34bbf698/5ae282150e2e72e8e1be4a9a/1524794192378/DbnNYUiXcAA1wkI.jpg?format=original">
</section>
<section data-state="creative">
<h2>Programming is <span class="glitch creative">creative</span>.</h2>
</section>
<section data-state="knowledge">
<div id="knowledge"></div>
</section>
<section>
<h2>Demystify generative art</h2>
</section>
<section data-background-image="img/caustics.gif">
<h2>Demystify generative art</h2>
</section>
<!-- <section data-background-color="white">
<img src="img/caustics-path.png">
<p class="small"><a href="http://lgg.epfl.ch/publications/2014/Caustics/paper.pdf">Schwartzburg et al., 2014</a></p>
</section> -->
<section data-background-color="white">
<img src="img/caustics-voronoi.png">
<p class="small"><a href="http://lgg.epfl.ch/publications/2014/Caustics/paper.pdf">Schwartzburg et al., 2014</a></p>
</section>
<section data-background-color="white">
<img src="img/voronoi-stippling.png" style="max-height: 80vh;">
<p class="small"><a href="https://beta.observablehq.com/@mbostock/voronoi-stippling">Bostock, 2018</a></p>
</section>
<!-- <section data-background-color="white">
<img src="img/monalisa.png" style="max-height: 80vh;">
<p class="small"><a href="http://www.psy.ritsumei.ac.jp/~akitaoka/slit-e.html">Kitaoka, 2015</a></p>
</section> -->
<section data-background-color="white">
<h3 class="black fragment">I. Shepherding Random Numbers</h3>
<h3 class="black fragment">II. Mutating L-Systems</h3>
<h3 class="black fragment">III. Summary</h3>
</section>
<section data-background-color="white">
<h3 class="black">I. Shepherding Random Numbers</h3>
<h3 class="light">II. Mutating L-Systems</h3>
<h3 class="light">III. Summary</h3>
</section>
<section data-state="circle">
<h2>Randomly stamp circles</h2>
<pre><code data-trim data-noescape class="javascript large">
cx += random()
cy += random()
</code></pre>
<div id="circle"></div>
</section>
<section data-state="line">
<h2>Directional randomness</h2>
<pre><code data-trim data-noescape class="javascript large">
cx += random() * 0.2
cy += random() * 10
</code></pre>
<div id="line"></div>
</section>
<section data-state="line-order">
<h2>Shepherding random numbers</h2>
<pre><code data-trim data-noescape class="javascript large">
velocity = random()
accumulating = running_sum(velocity)
c += velocity + accumulating
</code></pre>
<div id="line-order"></div>
<p class="small"><a href="https://inconvergent.net/2016/shepherding-random-numbers/">Hoff, 2016</a></p>
</section>
<section data-state="line-order-more">
<h2>More shepherding</h2>
<div id="line-order-more"></div>
</section>
<section data-state="line-order-2d">
<h2>Shepherding in 2D</h2>
<div id="line-order-2d"></div>
</section>
<section data-state="line-order-2d-small-step">
<h2>Two random volecities in 2D</h2>
<pre><code data-trim data-noescape class="javascript large">
c += velocity + accumulating + anotherVelocity
</code></pre>
<div id="line-order-2d-small-step"></div>
</section>
<!-- <section data-state="circle-order">
<h2>Shepherding on circle</h2>
<pre><code data-trim data-noescape class="javascript large">
cy += velocities[N..N-100] + accumulates[N..N-100]
</code></pre>
<div id="circle-order"></div>
</section> -->
<section data-state="divergent">
<div id="divergent"></div>
</section>
<section>
<h3>I. Shepherding Random Numbers</h3>
<p>||</p>
<p>Starting points</p>
<p>+</p>
<p>random offsets</p>
<p>+</p>
<p>accumulated random offsets</p>
</section>
<section data-background-color="black">
<h3 class="dark">I. Shepherding Random Numbers</h3>
<h3>II. Mutating L-Systems</h3>
<h3 class="dark">III. Summary</h3>
</section>
<section>
<h3>String Substitutions</h3>
<img src="img/ababa.png" style="max-height: 80vh;">
<p class="small"><a href="http://algorithmicbotany.org/papers/abop/abop.pdf">Prusinkiewicz & Lindenmayer, 2004</a></p>
</section>
<section>
<h3>Turtle graphics</h3>
<img src="img/turtlegraphics.png" style="max-height: 80vh;">
<p class="small"><a href="http://algorithmicbotany.org/papers/abop/abop.pdf">Prusinkiewicz & Lindenmayer, 2004</a></p>
</section>
<section data-state="rectangles-1">
<h3>Draw a rectangle</h3>
<pre><code data-trim data-noescape class="javascript">
{
start: 'F-F-F-F'
}
</code></pre>
<div id="rectangles-1" class=""></div>
</section>
<section>
<h3>Substitute F</h3>
<pre><code data-trim data-noescape class="javascript">
{
start: 'F-F-F-F',
rule: {
F: 'FF-F+F-F-FF',
}
}
// FF-F+F-F-FF
// -FF-F+F-F-FF
// -FF-F+F-F-FF
// -FF-F+F-F-FF
</code></pre>
</section>
<section data-state="rectangles-2">
<div id="rectangles-2" class="col-2"></div>
</section>
<section data-state="rectangles-3">
<div id="rectangles-3"></div>
</section>
<section data-state="rectangles-4">
<div id="rectangles-4"></div>
</section>
<section data-state="rectangles-5">
<div id="rectangles-5"></div>
</section>
<section data-state="rectangles-6">
<div id="rectangles-6"></div>
</section>
<section data-state="hilbert">
<div id="hilbert"></div>
<p class="small"><a href="https://en.wikipedia.org/wiki/Hilbert_curve#Representation_as_Lindenmayer_system">Hilbert Curve</a></p>
</section>
<section data-state="penrose">
<div id="penrose"></div>
<p class="small"><a href="https://en.wikipedia.org/wiki/Penrose_tiling">Penrose Tiling</a></p>
</section>
<!-- <section data-state="blank">
</section> -->
<section data-state="rectangles-mutate">
<div id="rectangles-mutate"></div>
</section>
<section>
<h3>Mutation: Randomly replace a rule</h3>
<p class="fragment">F: 'FF-F+F-F-FF'</p>
<p class="fragment">↓</p>
<p class="fragment">F: 'F<span class="yellow">-</span>-F+F-F-FF'</p>
<p class="fragment">↓</p>
<p class="fragment">F: 'F--F+F<span class="yellow">F</span>F-FF'</p>
<p class="fragment">↓</p>
<p class="fragment">F: 'F--F+F-F-<span class="yellow">+</span>F'</p>
</section>
<section data-state="dragon-curve">
<div id="dragon-curve"></div>
<p class="small">Dragon curve</a></p>
</section>
<section data-state="dragon-curve-mutate">
<div id="dragon-curve-mutate"></div>
</section>
<!-- <section data-state="blank">
</section> -->
<section>
<h3>II. Mutating L-Systems</h3>
<p>L-Systems are recursive, substitution functions.</p>
<p>Changing a character can change the whole picture.</p>
</section>
<section>
<h3 class="dark">I. Shepherding Random Numbers</h3>
<h3 class="dark">II. Mutating L-Systems</h3>
<h3>III. Closing</h3>
</section>
<section>
<h3>Embrace uncertainty</h3>
</section>
<section>
<h3>Treat trial and error as normal</h3>
</section>
<section>
<h3>Logics can complement creativity</h3>
</section>
<section data-state="end-slide">
<p>Slides at <a href="https://spaxe.github.io/programming-generative-art/">spaxe.github.io/programming-generative-art</a></p>
<div id="end-slide"></div>
<h3 style="padding-top: 5vh;">Programming Generative Art</h3>
<p><a href="https://twitter.com/Xavier_Ho">@Xavier_Ho</a></p>
<p>Front-End Development | Data61</p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.3/lib/alea.min.js"></script>
<script type="module" src="js/drawing.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
// { src: 'plugin/embed-tweet/embed-tweet.js' },
],
history: true,
progress: false,
controls: false,
width: window.innerWidth,
height: window.innerHeight,
});
</script>
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</body>
</html>