-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCh1_squiggle_mark
42 lines (35 loc) · 1.11 KB
/
Ch1_squiggle_mark
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
//>To consider some custom computational marks
//a squiggle is created in terms of radius, length, and the following actions
//currentLength starts at 0
//currentAngle starts at 0
//points starts as an empty list
//x starts at radius
//y starts at 0
//while currentLength is less than or equal to length:
// new X is set to radius x cos(currentAngle)
// add the (newX, newY) to points list
// currentLength is set to be the length of a line through points list
// currentAngle is modified by a random value between -3 and 3
//create a smooth line through the points list
//http://learningprocessing.com/examples/chp06/example-06-08-drawisaloop
// Example 6-8: Lines one at a time
// No for loop here. Instead, a global variable.
int y = 0;
void setup() {
size(480, 270);
background(255);
// Slowing down the frame rate so we can easily see the effect.
frameRate(5);
}
void draw() {
// Draw a line
stroke(0);
// Only one line is drawn each time through draw().
line(0,y,width,y);
// Increment y
y += 10;
// Reset y back to 0 when it gets to the bottom of window
if (y > height) {
y = 0;
}
}