This file contains hidden or 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
| function setup() { | |
| createCanvas(720, 400); | |
| } | |
| function draw() { | |
| background(0); | |
| noStroke (0); | |
| from = color (255, 0, 0, 0.1 * 255); | |
| to = color (255, 255, 0, 1.0 * 255); | |
| lerp1 = lerpColor(from, to, 0.33); |
This file contains hidden or 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
| function setup () { | |
| createCanvas(1152, 648); | |
| background(0); | |
| } | |
| function draw () { | |
| loadPixels(); | |
| var d = pixelDensity(); | |
| var t = 4 * (width * d) * (height * d); | |
| for (var i = 0; i < t; i += 4) { |
This file contains hidden or 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
| function setup() { | |
| createCanvas(720, 400); | |
| } | |
| function draw() { | |
| background(0, random(170, 255), random(170, 255)); | |
| noStroke(0); | |
| for (var i = 0; i < 20; i++) { | |
| // quad a | |
| var x1 = random(0, 360); |
This file contains hidden or 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
| function setup() { | |
| createCanvas(720, 400); | |
| } | |
| function draw() { | |
| background(0, random(128, 255), random(128, 255)); | |
| noStroke(0); | |
| for (var i = 0; i < 20; i++) { | |
| // triangle a | |
| var x1 = random(0, 360); |
This file contains hidden or 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
| var l = new p5.Vector(576, 324); | |
| var v = new p5.Vector(16, 9); | |
| function setup() { | |
| createCanvas(1152, 648); | |
| } | |
| function draw() { | |
| background(255); | |
| l.add(v); |
This file contains hidden or 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
| float [] x; | |
| float [] y; | |
| float [] xv; | |
| float [] yv; | |
| int population = 100; | |
| void setup() { | |
| size(1024, 576); | |
| frameRate(60); | |
| x = new float[population]; |
This file contains hidden or 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
| ArrayList population; | |
| void setup() { | |
| size(1024, 576); | |
| smooth(); | |
| frameRate(30); | |
| population = new ArrayList(); | |
| for(int i=0; i<200; i++) { | |
| Ball myBall = new Ball(random(0,width),random(0,200)); | |
| population.add(myBall); |
This file contains hidden or 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
| ArrayList population; | |
| void setup() { | |
| size(1024, 576); | |
| smooth(); | |
| frameRate(30); | |
| population = new ArrayList(); | |
| } | |
| void draw() { |
This file contains hidden or 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
| void setup () { | |
| size(1024, 576); | |
| noFill(); | |
| smooth(); | |
| colorMode(HSB, 270, 100, 100); | |
| frameRate(10); | |
| } | |
| void draw () { | |
| background(0); |
This file contains hidden or 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
| Ball[] population = new Ball[400]; | |
| void setup() { | |
| size(1024, 576); | |
| smooth(); | |
| frameRate(30); | |
| for(int i=0; i<400; i++) { | |
| population[i] = new Ball(random(0, width), random(0, 100)); | |
| } | |
| } |