-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding all the files for the examples
- Loading branch information
1 parent
27d1afc
commit aa62667
Showing
19 changed files
with
425 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
# generativeExamples | ||
# generativeExamples | ||
|
||
This is a collection of examples made in Processing that export pdfs for plotting. Across the examples are different methods to create patterns that are affected by Perlin noise. The patternMaker is a more robust application with a gui and the ability to drag and drop in svg files to try out many shapes. | ||
### generativeHlines | ||
![sample1](./images/hLines.png) | ||
|
||
### generativeHashMarks | ||
![sample1](./images/hashLines.png) | ||
|
||
### generativeCircles | ||
![sample1](./images/circlesNoise.png) | ||
|
||
### generativeDecagonGrid | ||
![sample1](./images/decaGrid.png) | ||
|
||
### generativeArrowRotate | ||
![sample1](./images/arrowTurn.png) | ||
|
||
### patternMaker_v2 | ||
![sample1](./images/patternM.png) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Example of using noise to rotate a grid of arrows | ||
*/ | ||
int version = 0; //if we grab multiple frames, they will be numbered | ||
float timeSeed = 0.1; //seed for the third dimension of the noise | ||
|
||
import processing.pdf.*; | ||
|
||
boolean saveOneFrame = false; | ||
|
||
void setup() { | ||
size(1000, 1000); //resolution does not really matter since we are working with vectors | ||
frameRate(24); | ||
smooth(); | ||
} | ||
|
||
void draw() { | ||
if (saveOneFrame == true) { //turn on recording for this frame if we clicked the mouse | ||
beginRecord(PDF, "Line_"+version+".pdf"); | ||
} | ||
|
||
background(255); | ||
noFill(); | ||
stroke(0); | ||
strokeWeight(1); | ||
timeSeed = millis()/5000.0; //change noise over time | ||
for (int cy = 40; cy < height; cy+=40) { //iterate down the page | ||
for (int cx = 40; cx < width; cx+=40) { //iterate across the page | ||
pushMatrix(); | ||
translate(cx, cy); //set the position of each arrow | ||
rotate(4.0*PI*noise(cx/400.0, cy/400.0, timeSeed)); //rorate using noise | ||
scale(1); | ||
arrow(); //draw our arrow | ||
popMatrix(); | ||
} | ||
} | ||
if (saveOneFrame == true) { | ||
endRecord(); | ||
saveOneFrame = false; | ||
} | ||
} | ||
|
||
void mousePressed() { | ||
saveOneFrame = true; | ||
} | ||
|
||
void arrow() { //custom shape for our arrow | ||
beginShape(); | ||
vertex(0, -55); | ||
vertex(6, 0); | ||
vertex(16, 10); | ||
vertex(2, 10); | ||
vertex(0, -10); | ||
vertex(-2, 10); | ||
vertex(-16, 10); | ||
vertex(-6, 0); | ||
vertex(0, -55); | ||
endShape(); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Example of co-centric circles plus Perlin Noise | ||
*/ | ||
int version = 0; //if we grab multiple frames, they will be numbered | ||
float timeSeed = 0.6; //seed for the third dimension of the noise | ||
PVector l1, l2; //two points for our lines | ||
|
||
import processing.pdf.*; | ||
|
||
boolean saveOneFrame = false; | ||
|
||
void setup() { | ||
size(1000, 1000); //resolution does not really matter since we are working with vectors | ||
frameRate(24); | ||
smooth(); | ||
} | ||
|
||
void draw() { | ||
if(saveOneFrame == true) { //turn on recording for this frame if we clicked the mouse | ||
beginRecord(PDF, "Line_"+version+".pdf"); | ||
} | ||
|
||
background(255); | ||
noFill(); | ||
stroke(0); | ||
strokeWeight(1); | ||
translate(width/2, height/2); //start at the middle of the canvas | ||
//timeSeed = millis()/2000.0; //change noise over time | ||
|
||
for(float dia = 10.0; dia< width; dia+=10.0){ //iterate the diameter of the circles bigger | ||
beginShape(); | ||
float div = 2.0*PI/(dia/2.0); //divide 2PI over the number of sides | ||
for(float a = 0; a<=2.0*PI; a+=div){ //iterate around the circle | ||
float x = (cos(a)*dia); //change polar coordinates to cartesian | ||
float y = (sin(a)*dia); | ||
x += 400.0* noise(x/200.0, y/200.0, timeSeed)-200; //add some noise to change the position | ||
y += 400.0* noise(x/200.0, y/200.0, timeSeed)-200; | ||
vertex(x, y); //add a point to the circle | ||
} | ||
endShape(CLOSE); | ||
} | ||
|
||
if(saveOneFrame == true) { | ||
endRecord(); | ||
saveOneFrame = false; | ||
} | ||
} | ||
|
||
void mousePressed() { | ||
saveOneFrame = true; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Example of a grid of decagons with perlin noise | ||
*/ | ||
int version = 0; //if we grab multiple frames, they will be numbered | ||
float timeSeed = 0.1; //seed for the third dimension of the noise | ||
float noiseStr = 80.0; //strength of the noise effect | ||
|
||
import processing.pdf.*; | ||
|
||
boolean saveOneFrame = false; | ||
|
||
void setup() { | ||
size(1000, 1000); //resolution does not really matter since we are working with vectors | ||
frameRate(24); | ||
smooth(); | ||
} | ||
|
||
void draw() { | ||
if (saveOneFrame == true) { //turn on recording for this frame if we clicked the mouse | ||
beginRecord(PDF, "Line_"+version+".pdf"); | ||
} | ||
|
||
background(255); | ||
noFill(); | ||
stroke(0); | ||
strokeWeight(1); | ||
timeSeed = millis()/5000.0; //change noise over time | ||
for (int cy = 0; cy < height+100; cy+=50) { //iterate down the page | ||
for (int cx = 0; cx < width+100; cx+=50) { //iterate across the page | ||
beginShape(); | ||
float div = 2.0*PI/10.0; //divide 2PI into 1/10ths | ||
for (float a = 0; a<=2.0*PI; a+=div) { //work around the circle | ||
float x = (cos(a)*60) + cx; //convert polar to cartesian | ||
float y = (sin(a)*60) + cy; | ||
x += noiseStr* noise(x/150.0, y/150.0 + timeSeed*2, timeSeed)-100; //add noise to each point | ||
y += noiseStr* noise(x/150.0, y/150.0 + timeSeed*2, timeSeed)-100; | ||
vertex(x, y); //add the point to the shape | ||
} | ||
endShape(CLOSE); | ||
} | ||
} | ||
if (saveOneFrame == true) { | ||
endRecord(); | ||
saveOneFrame = false; | ||
} | ||
} | ||
|
||
void mousePressed() { | ||
saveOneFrame = true; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Example of horizontal lines with spaces creating hash marks with Perlin Noise | ||
*/ | ||
int version = 0; //if we grab multiple frames, they will be numbered | ||
float timeSeed = 0.6; //seed for the third dimension of the noise | ||
PVector l1, l2; //two points for our lines | ||
|
||
import processing.pdf.*; | ||
|
||
boolean saveOneFrame = false; | ||
|
||
void setup() { | ||
size(1000, 1000); //resolution does not really matter since we are working with vectors | ||
frameRate(24); | ||
l1 = new PVector(0,0); //setup our points | ||
l2 = new PVector(0,0); | ||
smooth(); | ||
} | ||
|
||
void draw() { | ||
if(saveOneFrame == true) { //turn on recording for this frame if we clicked the mouse | ||
beginRecord(PDF, "Line_"+version+".pdf"); | ||
} | ||
|
||
//timeSeed = millis()/2000.0; //change noise over time | ||
background(255); | ||
noFill(); | ||
stroke(0); | ||
strokeWeight(1); | ||
|
||
for(int j = -200; j< height*2; j+=5){ //iterate down the page | ||
l1.set(0, j-(noise(0, j/300.0, timeSeed)*200.0)-500.0); //reset the initial point at the start of each new line | ||
for(float i = 0; i<width+40; i+=40){ //iterate across the page | ||
l2.set(i-10, j+(noise(i-10.0/600.0, j/600.0, timeSeed)*200.0)-500.0); //set the next point in the line | ||
line(l1.x, l1.y, l2.x, l2.y); //draw a line from the last point to the new one | ||
l1.set(i, j+(noise(i/600.0, j/600.0, timeSeed)*200.0)-500.0); //copy the new point into the old variable for the next loop | ||
} | ||
} | ||
|
||
if(saveOneFrame == true) { | ||
endRecord(); | ||
saveOneFrame = false; | ||
} | ||
} | ||
|
||
void mousePressed() { | ||
saveOneFrame = true; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Example of generative piece using horizontal lines and Perlin Noise | ||
*/ | ||
int version = 0; //if we grab multiple frames, they will be numbered | ||
float timeSeed = 0.6; //seed for the third dimension of the noise | ||
PVector l1, l2; //two points for our lines | ||
|
||
import processing.pdf.*; | ||
|
||
boolean saveOneFrame = false; | ||
|
||
void setup() { | ||
size(1000, 1000); //resolution does not really matter since we are working with vectors | ||
frameRate(24); | ||
l1 = new PVector(0,0); //setup our points | ||
l2 = new PVector(0,0); | ||
smooth(); | ||
} | ||
|
||
void draw() { | ||
if(saveOneFrame == true) { //turn on recording for this frame if we clicked the mouse | ||
beginRecord(PDF, "Line_"+version+".pdf"); | ||
} | ||
|
||
//timeSeed = millis()/2000.0; //change noise over time | ||
background(255); | ||
noFill(); | ||
stroke(0); | ||
strokeWeight(1); | ||
|
||
for(int j = -200; j< height*2; j+=5){ //iterate down the page | ||
l1.set(0, j-(noise(0, j/300.0, timeSeed)*1000.0)-500.0); //reset the initial point at the start of each new line | ||
for(float i = 0; i<width+40; i+=40){ //iterate across the page | ||
l2.set(i, j+(noise(i/300.0, j/300.0, timeSeed)*1000.0)-500.0); //set the next point in the line | ||
line(l1.x, l1.y, l2.x, l2.y); //draw a line from the last point to the new one | ||
l1=l2.copy(); //copy the new point into the old variable for the next loop | ||
} | ||
} | ||
|
||
if(saveOneFrame == true) { | ||
endRecord(); | ||
saveOneFrame = false; | ||
} | ||
} | ||
|
||
void mousePressed() { | ||
saveOneFrame = true; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.