View Single Post
  #5 (permalink)  
Old 04-26-2010, 10:30 AM
orangekid's Avatar
orangekid
Awesomenss :)
Offline
 
Join Date: Apr 2009
Posts: 6,973
Reputation: 7530
orangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the communityorangekid is a trusted member of the community
Mentioned: 34 Post(s)
Tagged: 0 Thread(s)
Send a message via AIM to orangekid Send a message via MSN to orangekid Send a message via Yahoo to orangekid
Re: Dual-Touch SDK for Resistive Screens V1.0 Beta

quoted from post #47 to explain how this works.




Just tested on the touch pro. Works.

But, there are limitations.
It can only detect motion of the second point pressed.
If both are pressed at nearly the exact time, it does not work.
If you do move the first finger pressed, the position of the second point is not calculted correctly. I don't really see a way to calculate it correctly, since it isn't really detecting both pressed points.

It's detecting the 2 points were pressed in a very short amount of time.
So, it uses the coordinates of the 1st press, and the registered point of the second press, to calculate where the second finger is based on the first point.

If you draw a line between the 2, the registered point is half way.
So the algorithm is pretty simple.
Something like:

2 * (2nd registerd point(xM,yM) - 1st press (x1,y1) ) + (x1, y1) = (x2,y2)

where (x1,y1) is actual position of finger 1
where (x2,y2) is actual position of finger 2
where (xM,yM) is actual position regsitered when the 2nd finger is added.
Reply With Quote