NOC WEEK2
PROCESS
My original sketch uses the ml5 model to detect my hands, so when I pinch my index finger an thumb together it can move the falling flowers and release them.
To incorporate the createVector function, I’m using it mainly for the falling flowers. The tricky part about it is that I’m restraing the flowers within the canvas, so I needed to access the x and y axis while using vector, which took me a while to figure out.
First, I combined the x and y position and speed into position and velocity using createVector function.
The major change that I made for this sketch is the update function when the flowers is being pinched then released, how they would fly off the screen and disappear.
I used the add() to combine velocity with the x and y position, and setMag to constrain the magnitude to 1 for they velocity, so the if function still stands. I’m using this.pos.y to access the y position, which I did not know that I could do, to compare it to the flower radius. Once it is higher than the height of the canvas and the radius of the flower, it accerlates and flies off the screen.
SOLVED PROBLEMS
- accessing x and y within vectors
 - createVector function
 
REFERENCES
Vectors - Nature of CodeAcceleration Vector - Coding Train