I have a Processing dilemma. What I am essentially trying to do is modify the 3D flocking "Birds" example on
processing.org so that void mousePressed() will add another "bird" to the environment (birdCount), and so that colorR and size (w & h, or another value like sizeMultiplier to scale w & h) will be mapped to a pulse sensor value I will be getting from an Arduino. However, with the way the arrays are set up in the example, this seems impossible by means of a simple modification. Here is the code I am working with, which I am hoping you can help me make more sense of:
// Flock array
int birdCount = 10;
//CLICK TO ADD ONE TO BIRDCOUNT--DOES NOT WORK
//void mousePressed() {
// birdCount += 1;
//}
Bird[]birds = new Bird[birdCount];
float[]x = new float[birdCount];
float[]y = new float[birdCount];
float[]z = new float[birdCount];
float[]rx = new float[birdCount];
float[]ry = new float[birdCount];
float[]rz = new float[birdCount];
float[]spd = new float[birdCount];
float[]rot = new float[birdCount];
void setup() {
size(800, 600, P3D);
noStroke();
// Initialize arrays with random values
for (int i = 0; i < birdCount; i++){
birds[i] = new Bird(random(-300, 300), random(-300, 300),