Hi there this is my first post. I am an art student in my second year, and I am currently trying to make my first installation with processing. what I am trying to do is create a program where by from the center of the screen multiple lines (branches) grow at a slow speed. Then through external sound i.e. external mic change direction. The bit i am having a lot of trouble with at the moment is creating a line that continues to grow and branch off in real time.
this is what i have got so far, i know its not even close but its something. any help would be much appreciated.
:D
import toxi.geom.*;
import peasy.*;
PeasyCam cam;
branch sean;
void setup (){
size (600,600, P3D);
smooth();
cam = new PeasyCam(this, 100);
Vec3D v = new Vec3D (0,0,0);
Vec3D inivel = new Vec3D (1,0,0);
sean = new branch(v, inivel);
}
void draw() {
background(0);
noFill();
stroke(80);
box(600);
sean.run();
}
class branch {
Vec3D loc;
Vec3D oriLoc;
Vec3D vel;
branch(Vec3D _loc, Vec3D _vel){
loc =_loc;
oriLoc = loc.copy();
vel = _vel;
}
void run (){
display();
updateLoc();
// updateDir();
}
void updateLoc(){
loc. addSelf(vel);
}
void updateDir(){
float angle1 = radians(30);
vel. rotateZ (angle1);
}
void display(){
stroke(250,0,0);
strokeWeight(4);
point (loc.x, loc.y, loc.z);
stroke(250);
strokeWeight(1);
line (loc.x, loc.y, loc.z, oriLoc.x, oriLoc.y, oriLoc.z);
}
}
1