29/09/17
First entry for Nomadic. Excited and scared at the same time.
I got my LEAP Motion Sensor a few days back and have been playing around with it. Showed a few friends and got some feedback on the sensitivity and perhaps more methods of how I could execute it.
Pipeline (for now I guess):
1. Create a single handed control mechanism without LEAP to test the feasibility
- Possibly implementation of place holders and using mouse positions to test
2. Bring in the LEAP Motion Library and STK
3. Port particle system over
4. Bug fixes(?)
Figured that I’ll start with using mouse positions on Processing as single handed use of the LEAP might be emulating the same technique as positioning on a digital display. Also, using ellipses as place holders before porting over our particles for the elements. We’ll see how it goes.
void draw(){
fill(0, 0, 0, opacity);
ellipse(mouseX, mouseY, 20, 20);
opacity--;
Did not seem to work as well as I thought. As I continued moving my mouse around, the opacity decreased instead of creating a trail of fading ellipses. I might need a timer variable(or constant) to control fade?
void draw(){
fill(255, 25);
rect(0,0,width,height);
fill(0);
ellipse(mouseX, mouseY, 20, 20);
Decided to create my background(255); in my setup(); and draw a rectangle with a constant 25 alpha(opacity) over the ellipse. It seemed to have done the trick but it leaves a a residue.
This is barely seen on my screen so I photoshopped a -200% contrast to make it a little more obvious. It seems like a leftover trail that perhaps could’ve be caused by 25 alpha.
I’ll have to find a way to solve this.
void draw(){
filter(DILATE);
fill(0, 50);
rect(0,0,width,height);
fill(255);
ellipse(mouseX, mouseY, 50, 50);
Changing it to 50 alpha seems to have solved the leftover problem(or perhaps made it really difficult for the human eyes or screen resolution to detect).
I also added a filter to make it a tad bit snappier. Was playing around with either DILATE or BLUR but it seems like there is a form of delay with BLUR which I am not very happy with, even when intensity has been dropped.
I feel this isn’t giving me enough controls and might just throw the ellipses into an array. But throwing things into an array might overcomplicate things as I’m using 3D particles and not ellipses. None-the-less, for the sake of SCIENCE, I shall try it out in arrays.
float [] x = new float [50];
float [] y = new float [50];
void setup() {
size(800, 800);
smooth();
background(0);
noStroke();
frameRate(60);
}
void draw() {
background (0,0,0);
for (int i = 0; i < 49; i++) {
x[i] = x [i+1];
y[i] = y [i+1];
fill (255);
ellipse (x[i], y[i], i, i);
}
x[49] = mouseX;
y[49] = mouseY;
}
I got really stuck on how to proceed from here and had to refer to a bunch of websites for solutions on how arrays could work. I tried implementing arrays into a Ball class but that didn’t seem to work out well as it meant I had to control multiple factors that came with a class. After stumbling across a project on openprocessing, I was heavily influenced to try out arrays on the x and y position instead. It seemed to work and I have a first prototype of what I want to implement.
A quick import of the LEAP library gave me this example that I could play with and after seeing the code, I was quite flabbergasted. I thought it would an easy job to just integrate my code and receive the x and y positions of the leap as output to replace my mouseX and Y position but I’m thoroughly wrong.
I’ll be reading up on a couple of tutorials over the next few days to ensure I understand what’s going on before even continuing. Cheers guys.