We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › multi-touch (2 point) interaction Library
Page Index Toggle Pages: 1
multi-touch (2 point) interaction Library? (Read 3201 times)
multi-touch (2 point) interaction Library?
Jun 25th, 2009, 3:04am
 
Hi:

I just got an infrared touch panel that will support 2 point interaction, meaning it can track first finger as mouse 1 and second as mouse 2, that's how the manufacturer explained to me.

I'm wondering if I can implement the second mouse in Processing, is there a library available?

thanks in advance.
Re: multi-touch (2 point) interaction Library?
Reply #1 - Jun 25th, 2009, 4:47am
 
Looks like strongly tied to hardware. Ask the manufacturer if it has a Java library/driver. Otherwise, if it offers only a C (native code) driver, you have to write an interface with JNI or JNA.
Re: multi-touch (2 point) interaction Library?
Reply #2 - Jun 25th, 2009, 1:23pm
 

Code:
multi-touch (2 point) interaction Library?
Today at 3:04am Quote
Hi:

I just got an infrared touch panel that will support 2 point interaction, meaning it can track first finger as mouse 1 and second as mouse 2, that's how the manufacturer explained to me.

I'm wondering if I can implement the second mouse in Processing, is there a library available?

thanks in advance.


Yes, TUIO have a Implementation for Processing.

but it's  necessary to have an other application that get multiples "mouses" (fingers)
Tbeta is a good option


I 'm developing an application thats receives TUIO messages for processing, and repassing for PureData with OSC protocol.

I don't have a good code yet, but once you get good, I put it
Re: multi-touch (2 point) interaction Library?
Reply #3 - Jun 30th, 2009, 7:12am
 
I have the same problem. Now I use the library JMyron and try to  combine the brightness tracking function with using webcam as mouse function. It works well when it has only one brightest glob in the screen. However, if there are multi brightest globs, the camera just get to confuse. I guess "boolean[]" would control each mouse's availability, and give true/fales value to each new mouse... Huh  I have no idea now Embarrassed

this is my code and if any one can continue it...:

import JMyron.*;
JMyron m;

int maxMice = 5;
// flags that control each mouse's availability
boolean[] isFree = new boolean[maxMice];

float objx = 320;
float objy = 240;
float objdestx = 320;
float objdesty = 240;

void setup(){
 size(320,240);
 m = new JMyron();//make a new instance of the object
 m.start(width,height);//start a capture
 m.trackColor(255,255,255,2);//R, G, B, and range of similarity
 m.minDensity(100); //minimum pixels in the glob required to result in a box
 println("Myron " + m.version());
 noFill();
}

void draw(){
 m.update();//update the camera view
 //background(255);
 drawCamera();//draw the camera to the screen
 int[][] b = m.globBoxes();//get the center points

 float avX=0;
 float avY=0;
   
 //draw the boxes
 stroke(255,0,0);
 for(int i=0;i<b.length;i++){
   rect( b[i][0] , b[i][1] , b[i][2] , b[i][3] );
   
   avX += b[i][0];
   avY += b[i][1];
 }

  if(b.length-1>0){
   avX/=b.length-1;
   avY/=b.length-1;
 }

//mouse follow
  if(!(avX==0&&avY==0)&&b.length>0){
   objdestx = avX;
   objdesty = avY;
 }
 objx += (objdestx-objx)/10.0f;
 objy += (objdesty-objy)/10.0f;
 noFill();
 
 ellipse(objx,objy,30,30);

}


void drawCamera(){
 int[] img = m.image(); //get the normal image of the camera
 loadPixels();
 for(int i=0;i<width*height;i++){ //loop through all the pixels
   pixels[i] = img[i]; //draw each pixel to the screen
 }
 updatePixels();

}

public void stop(){
 m.stop();//stop the object
 super.stop();
}
Re: multi-touch (2 point) interaction Library?
Reply #4 - Jan 5th, 2010, 11:28am
 
I'm using an infrared touchscreen panel where it connects to the computer via USB. It's more compact and easy to setup than a camera tracking touchscreen system.

How can I hack it so I can do multi-touch in window 7?
Re: multi-touch (2 point) interaction Library?
Reply #5 - Jan 5th, 2010, 2:01pm
 
Where did you get that piece of hardware? Do you have any link / documentation?
Re: multi-touch (2 point) interaction Library?
Reply #6 - Apr 25th, 2010, 11:06pm
 
the manufacturer is called Leading Touch, based in China. Below is the product page:

http://www.leadingtouch.com/product/infrared.php?catid=002002003&menuid=00200200...
Page Index Toggle Pages: 1