I'm working on the code below for a college project. I need to set it up as following but have no idea where to start. The original sketch was not developed by me and can be viewed here:
http://www.openprocessing.org/sketch/58970
Basically what I am trying to do is position the dust particles in the center of the stage and remove all mouse interaction.
I am using an Epoc headset with Mind My OSCs to import five readings. What I am hoping to do is use one of the readings (most likely excitement) to control the entire sketch.
Rather than using a mouse click function, I want the sketch to run constantly.
int longness = 10000; This line controls the amount of lines/particles on the canvas and I was wondering if it would be possible to increase and decrease this value based on the headset reading (excitement level).
I have spent days at this and have gotten nowhere. I would appreciate any help you can give me.
Thanks,
Keelan
import oscP5.*;
import netP5.*;
public float engBor = 0; // Engaged/Bored
public float exc = 0; // Excitement
public float excLon = 0; // Excitement Long Term
public float med = 0; // Meditation
public float fru = 0; // Frustration
OscP5 oscP5;
int longness = 10000;
spring[] springs = new spring[longness];
void setup() {
background(0, 0, 0);
size(500, 500, P2D);
colorMode(HSB);
for (int i = 0; i < longness; i++) {
springs[i] = new spring(random(width), random(height), i);
oscP5 = new OscP5(this, 7400);
// plug the OSC messages for the Affectiv values
oscP5.plug(this,"updateEngBor","/AFF/Engaged/Bored");
oscP5.plug(this,"updateExc","/AFF/Excitement");
oscP5.plug(this,"updateExcLon","/AFF/Excitement Long Term");
oscP5.plug(this,"updateMed","/AFF/Meditation");
oscP5.plug(this,"updateFru","/AFF/Frustration");
}
}