Loading...
Logo
Processing Forum
Hello guys!

I have a problem and I can't find the solution.
Actually, I don't find how I can select a fiducials and check its position (with TUIO simulator). I want to match a fiducials to a planet of the solar system, and I have 9 planets. So, I need to identify each fiducial and each planet (with its coordinates) to check if the player has matched the right fiducials with the right coordinates .
If you have an idea let me know about it please ;)

thanks

Replies(4)

Hi chebba57,
download „TUIO_Processing.zip“ from „ http://reactivision.sourceforge.net/“.
Now open „TUIO_Processing.zip“.
Copy the folder „library“.
Go to „your processing folder(Processing) -> libraries“ and create a new folder called „TUIO“.
Paste „library“ from your downloaded .zip in your new folder „Processing -> libraries -> TUIO“.

Run „TUIO_Processing.zip -> examples -> TuioDemo.pde“.
Now you should see a black rectangle (with printed ID, X, Y and rotation) if you run your processing sketch while moving a fiducial in your TUIO Simulator.

Good luck.
-
Philipp Ronnenberg
Interaction design
-
http://www.phiron.de
Hi phironn,

Thanks for your reply.
Actually, I already intalled what I need to work with processing. The problem is just the programming...
Now, I have a table where I save the ID of my fiducial and its X and Y. I need to check these coordinates, matching them with the coordinates of my planet. If it's ok, a green circle will flash around the planet, if it doesn't it will flash in red.

Regards,

Warda

So what's your question then?
To check the positions try something like this, didn't test it so far:

Call this function from your draw() function.
You need three arrays and the width and height for your planets:
planetCoordsX, planetCoordsY, planetID
Copy code
  1. void fiducialOverPlanet() {
  2.   for(int i=0; i < planetCoordsX.length; i++) {
  3.     if (fiducialX > planetCoordsX[i] && fiducialX < planetCoordsX[i] + planetWidth &&
  4.     fiducialY > planetCoordsY[i] && fiducialY <  planetCoordsY[i] + planetHeight)
  5.     {
  6.          if(fiducialID == planetID[i]) fill(0,255,0); else fill(255,0,0);
  7.     }
  8.   }
  9. }

Cheers
-
Philipp Ronnenberg
Interaction design
-
http://www.phiron.de
I cannot make the TuioDemo.pde work..

I installed the library..

The only thing I get is a white screen that takes several seconds to load..