Laser-cut screen (in Progress)
I wanted to incorporate two factors into my screen: first, text. I know this may look slightly bizarre after having been laser cut — Ds and Os will be simply cut from the screen — but I do not feel this is disadvantageous. There are some beautiful examples in the codelab for design students on the level below EMS which to me feel typographic rather than incomplete. The second was some kind of setup such that there was more text towards the top. This is because the most light would shine through the screen at the top in this setup, which would be much more visually balanced. I also wanted some of the words, like “rain” to show vertically rather than horizontally.
[pictures would be helpful — pending]
To implement this I decided to try to use the mutual repulsion spring system we were shown as this would be an opportunity to use a particle system without having to pack but I could still use (reverse) gravity to draw the text upwards towards the top of the screen. I’m still having trouble getting it to work, though, as text() does not work in quite the same way as ellipse(), particularly when one is trying to retreive words from an array…
(If anyone could shed some light on this, it would be great…)
In the mean time, here is my code:
ArrayList
void setup() {
myWords = new ArrayList
//*
//* for (int i = 0; i < 10; i++) {
//* float rx = random(width);
//* float ry = random(height);
//* //myWords.add();
//* myWords += randomWord;
//* }
//
}
void draw(){
background(255);
float gravityForcex = -0.005;
float gravityForcey = 0;
float mutualRepulsionAmount = 1.0;
for (int i = 0; i< 20; i++)
{
words nextWord = myWords.get(i);
float wx = nextWord.wx;
float wy = nextWord.wy;
if (mousePressed) {
nextWord.addForce (gravityForcex, gravityForcey);
}
//this part I essentially copied... I just couldn't think of a better way to do it... but I worked through the whole thing.
for (int j=0; j 1.0) {
float componentInX = dx/dh;
float componentInY = dy/dh;
float proportionToDistanceSquared = 1.0/(dh*dh);
float repulsionForcex = mutualRepulsionAmount * componentInX * proportionToDistanceSquared;
float repulsionForcey = mutualRepulsionAmount * componentInY * proportionToDistanceSquared;
nextWord.addForce( repulsionForcex, repulsionForcey);
nextWord.addForce(-repulsionForcex, -repulsionForcey);
}
}
}
for (int i=0; i<50; i++) {
myWords.get(i).update(); //update
}
for (int i=0; i<50; i++) {
myWords.get(i).render(); // reeendering!!
}
}
// this is my other tab...
class words {
float wx;
float wy;
float vx;
float vy;
float mass;
words(float x, float y) {
wx = x;
wy = y;
vx = 0;
vy = 0;
mass = 1.0;
}
void addForce(float fx, float fy) {
float ax = fx/mass;
float ay = fy/mass;
vx+=ax;
vy += ay;
}
void update() {
wx +=vx;
wy += vy;
if (wx