top of page
Acerca de
Getting started
Download and open the ‘Processing' application. Write code in the editor and run the application to see the visualization of the code. Hit the Run button. Lather, rinse, repeat as necessary. More information on using Processing itself is can be found in the environment section of the reference. To learn the Processing language, we refereed to the built-in examples, and check reference. Learn the codes and make changes to create our own design.
Processing Alternatives
There are a few alternatives to the processing software we are using. For example -
-
Vvvv
-
Nodebox
-
OpenFrameworks
-
OpenRNDR
All these options work just fine and easy to use. But we are using Processing because it is very similar to Arduino programming and can interact with a arduino board very easily.
Our Works
01
Color Variables
This example creates variables for colors that may be referred to in the program by a name, rather than a number.
size(360, 720);
noStroke();
background(51, 0, 0);
color inside = color(105, 103, 0);
color middle = color(205, 155, 0);
color outside = color(150, 52, 0);
pushMatrix();
translate(80, 30);
fill(outside);
rect(0, 0, 200, 200);
fill(middle);
rect(40, 60, 120, 120);
fill(inside);
rect(60, 90, 80, 80);
popMatrix();
pushMatrix();
translate(80, 250);
fill(inside);
rect(0, 0, 200, 200);
fill(outside);
rect(40, 60, 120, 120);
fill(middle);
rect(60, 90, 80, 80);
popMatrix();
pushMatrix();
translate(80, 460);
fill(outside);
rect(0, 0, 200, 200);
fill(middle);
rect(40, 60, 120, 120);
fill(inside);
rect(60, 90, 80, 80);
popMatrix();
02
Mouse Follower
A segmented line follows the mouse. The relative angle from each segment to the next is calculated with atan2() and the position of the next is calculated with sin() and cos().
float[] x = new float[30];
float[] y = new float[30];
float segLength = 30;
void setup() {
size(1020, 560);
strokeWeight(15);
stroke(255, 100);
}
void draw() {
background(1000);
dragSegment(0, mouseX, mouseY);
for(int i=0; i<x.length-1; i++) {
dragSegment(i+1, x[i], y[i]);
}
}
void dragSegment(int i, float xin, float yin) {
float dx = xin - x[i];
float dy = yin - y[i];
float angle = atan2(dy, dx);
x[i] = xin - cos(angle) * segLength;
y[i] = yin - sin(angle) * segLength;
segment(x[i], y[i], angle);
}
void segment(float x, float y, float a) {
pushMatrix();
translate(x, y);
rotate(a);
line(0, 0, segLength, 0);
popMatrix();
}
03
Python Ball Chaos
Credits
Processing Coding and simulations done by -
MD SEZADUR RAHMAN - 22151470
MD FARHAD HOSSAIN - 22151447
UBED IBRAHIM - 22151456
bottom of page