Hello my dear (wish I could say fellow) Processing Pro's out there!
First of all, I'd like to start with letting you all know that I'm almost entirely new to Processing, a.k.a. a total noob.
Second, Processing is required for my study.
Third, I'm from Holland so if I'm not completely clear with my questions or explanations, please say so!
What's the idea?
We had to create a concept for a processing project. What did I create:
With the code in this post you're screen will be filled with a webcam feed on the left side and a rotary puzzle on the right side. This rotary puzzle consists out of 5 circles which move independently from eachother.
At this very moment you can solve this puzzle using your UP, DOWN, LEFT and RIGHT arrow keys.
It looks, in my opinion, pretty neat so far.
However, we need to create some sort of interface through the webcam (that was the main assignment).
So what I want to do is to be able to rotate the puzzle pieces by holding my hand in front of the cam.
The selection of which inner or outer circle you'll be rotating will still be done with the UP & DOWN arrow keys.
The rotation, however, has to be done by hand as I said.
I was thinking of doing this by wearing a glove or holding an object with a Red and a Blue section.
So what I need (atleast that's what I think I need ) is something that recognizes/detects those colors (color detection), and calculates the distance and angle between them. Then I need to link this webcam feed to the puzzle. So when I rotate my hand or the object with the two colors in front of the camera, the puzzle will rotate as well.
This is our current code (that still works with the arrow keys):
The question about this code is, is how the hell do I combine it with my own code?
And I think the color detection part comes first..
But I can't really find a color detection code that detects TWO colors..
The only ones out there find ONE color..
And if someone out here does find a code that detects two colors, it'll be very helpful BUT what I really need to know then is how to combine it with my current code..
So.. any help is appreciated.
I really hope anyone out there can help me out with this.
My deadline is Thursday and there has been some unexpected situations that slowed me down on this, this week.
This post is about an individual exercise I have to do for Processing at school. However, I can't seem to work it out after several tries. They seem rather simple for those who get Processing. I can't seem to find a good start though.
If someone could lend me a hand on doing these or finding the right functions I need, many thanks! Due to personal problems I haven't had time to do these so I've got to finish them before tonight. If anyone could help me, or create them for me and tell me how they've done it, this would extremely help me!!!
Here are the three exercices (they're originally written in dutch so please say so if I'm not clear in my explanation):
A.
Create a program that has a function that gives an output that exists out of the first ten numbers of the math table.
For example: if you input the number 3. The output will be the table of three (1x3, 2x3, 3x3, 4x3 etc.).
B.
Create a program that consists out of a new image (PImage) with the size of 200 x 200 pixels, which gets automatically colorized with a random color for each pixel. It has to have a dark gray background that isn't visible cause of the colorized randomness.
There are tips given for this exercise which I don't get:
Tip 1: Use a FOR-loop to input the colorvalue per pixel. It has be linked to the length of the pixel array of the image (image.pixels.length)
Tip 2: Use loadPixels and updatePixels.
C.
Create a program that consists out of a new image (PImage) with the size of 200 x 200 pixels, which, before it is being shown on the screen, gets colorized entirely white. Each time that the mouse cursor goes over a pixel in this image, this pixel has to become darker untill it's black. If the pixel is entirely black, the sketch becomes entirely white again, so the program "restarts".