generative art - university of waterloocs106/winter... · generative art generative art refers to...

16
Generative Art Slides by Professor Dan Vogel. Generative Art 1

Upload: others

Post on 10-Nov-2020

28 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art

Slides by Professor Dan Vogel.

Generative Art 1

Page 2: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

What is printed to the console on the 10th frame?

Generative Art 2

class Agent {int x;

Agent() {x = 0;

}

void update() {x = x + 1;

}}

Agent a = new Agent();

void draw() {a.update();println(a.x);

}

A. 0

B. 1

C. 9

D. 10

E. 11

Page 3: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Jackson Pollock

Generative Art 3

Page 4: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art 4

Page 5: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art

Generative art refers to art that in whole or in part has been

created with the use of an autonomous system. An

autonomous system in this context is generally one that is non-

human and can independently determine features of an

artwork that would otherwise require decisions made directly by

the artist.

https://en.wikipedia.org/wiki/Generative_art

Generative Art 5

Page 6: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art 6

How To Draw With Code: Casey Reashttps://youtu.be/_8DMEHxOLQE

Page 7: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Rules

1. start at random position with

random N, S, E, or W direction

2. each frame, decide if the line

should turn 90° clockwise

3. draw a line of random length in

current direction

4. if the line leaves the canvas, kill

it and start a new one

Generative Art 7

Page 8: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

1

2

3 4 5 6

7

8

9 10 11

1213

14

15

die

bornborn

Example of Generated Lines

Generative Art 8

frame

numbers

line left

canvas

new line is

“born” here

heading E

line is “born” here

heading N

Page 9: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Lines are Drawn by an “Agent”

Generative Art 9

class Agent {float x;float y;// 0 is N, 1 is E, 2 is S, 3 is Wint direction;boolean dead;

Agent() {...

}

void update() {...

}}

way to keep

track of direction

Page 10: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Lines are Drawn by an “Agent”

Generative Art 10

Agent a;

void setup() {...

// create agenta = new Agent();

}

void draw() {// update the agenta.update();

...}

Page 11: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art 11

1. start at random position with

random N, S, E, or W direction

Agent() {x = random(width);y = random(height);direction = int(random(0, 4));dead = false;

}

0, 1, 2, or 3

Page 12: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

probability of

changing

direction

Generative Art 12

2. each frame, decide if the line

should turn 90° clockwise

void update() {...

// decide if it changes direction if (random(100) < probTurn) {

direction = (direction + 1) % 4; }

...modulo 4 wraps

direction back to

0

Page 13: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art 13

3. draw a line of random length in

current direction

void update() { // save current positionint px = x;int py = y;

float step = random(1, maxStep);// step in the current directionif (direction == 0) {y -= step;

} else if (direction == 1) {x += step;

} else if (direction == 2) {y += step;

} else if (direction == 3) {x -= step;

}line(px, py, x, y);

change x or y

depending on

current direction

Page 14: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

Generative Art 14

4. if the line leaves the canvas, kill it …

void update() {...// kill if it leaves the canvasif (x < 0 || x > width || y < 0 || y > height) {

dead = true;}

… and start a new one

void draw() {...// create a new agent if this one diedif (a.dead) {

a = new Agent(); }

Page 15: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

generative1

Generative Art 15

start at random position with

random N, S, E, or W direction

each frame, decide if the line

should turn 90° clockwise

draw a line of random length in

current direction

if the line leaves the canvas,

kill it and start a new one

Page 16: Generative Art - University of Waterloocs106/Winter... · Generative Art Generative art refers to art that in whole or in part has been created with the use of an autonomous system

More Generative Art

Generative Art 16

Bohnacker, H., Gross, B., & Laub, J.

(2012). Generative Design: Visualize,

Program, and Create with Processing. http://www.generative-gestaltung.de/code

Pearson, M. (2011). Generative Art (1

edition). Shelter Island, NY : London:

Manning Publications.https://www.manning.com/books/generative-art