I can't figure out why my tree won't reverse. After it grows I want it to disappear in the opposite direction. Code is Daniel Shiffmans tree example and I used his Branch class.
ArrayList a;
float r= random (1,5);
boolean remove=false;
boolean finish=false;
void setup() {
size(600,600);
background(255);
smooth();
// Setup the arraylist and add one branch to it
a = new ArrayList();
Branch b= new Branch (new PVector (100, 300), new PVector (0.5f,-0.5f),300);
I looked at other reverse array topics but nothing seems to work with my sketch.
I'm working with code that draws a tree and I've used OpenCV to draw only when it sees your face. I would like to reverse the array when it stops seeing it, instead of just pausing the drawing. Would anyone know how to do this?
float[][] sprouts={{300,700,300,700,0.5+random(-0.001,0.001),random(-0.03,0.03),0,200+random(10),0,1}}; //intial branch angles of growth and number of generations