1
1
import processing.svg.* ;
2
2
int cols,rows;
3
- int scale = 10 ;
4
- int z_scale = 20 ;
3
+ int scale = 20 ;
4
+ int z_scale = 90 ;
5
5
int w = 900 ;
6
6
int h = 700 ;
7
- float small = 0.5 ;
7
+ float small = 0.4 ;
8
8
9
9
void setup () {
10
10
size (750 , 500 , P3D );
@@ -14,14 +14,21 @@ void setup() {
14
14
strokeWeight (1 );
15
15
stroke (0 ,0 ,0 );
16
16
noFill ();
17
-
18
- beginRaw (SVG , " drift_9.svg" );
17
+ int x_rot = round (random (3 , 5 ));
18
+ int y_rot = round (random (5 , 8 ));
19
+ int octave = round (random (1 , 4 ));
20
+ println (x_rot);
21
+ String saveName = " drift_" + x_rot + " _" + y_rot + " _" + octave + " .svg" ;
22
+ beginRaw (SVG , saveName);
19
23
20
24
// Move origin to rotate "camera"
21
25
translate (width / 2 , height / 3 * 2 );
22
- rotateX (PI / 5 );
26
+
27
+ rotateX (PI / x_rot);
28
+ rotateY (PI / y_rot);
29
+
23
30
// Move origin for placement of mesh
24
- translate (- w/ 2 , - h/ 2 , - h);
31
+ translate (- w/ 2 , - h/ 1. 2 , - h/ 8 );
25
32
26
33
for (int y = 0 ; y < rows; y++ ) {
27
34
beginShape (TRIANGLE_STRIP );
@@ -30,10 +37,8 @@ void setup() {
30
37
float scaled_y = y * small;
31
38
float scaled_yplus = (y + 1 ) * small;
32
39
float z = x* 1.2 + y* 1.2 ;
33
- // noiseDetail(2,0.5);
34
- // noiseDetail(5, 0.4);
35
- // noiseDetail(8, 0.5);
36
- noiseDetail (6 ,0.6 );
40
+
41
+ noiseDetail (octave, 0.5 );
37
42
vertex (x* scale, y* scale, noise (scaled_x,scaled_y)* z_scale + z);
38
43
vertex (x* scale, (y+ 1 )* scale, noise (scaled_x, scaled_yplus)* z_scale + z);
39
44
}
0 commit comments