jtse / puzzle

http://jtse.github.com/puzzle
1 stars 0 forks source link

Tracking Speed #1

Closed pgerhardstein closed 12 years ago

pgerhardstein commented 12 years ago

The correlation between finger dragging speed and piece movement is close, but not exact; when you drag a piece from the top to the bottom or the left to the right, if the finger starts in the middle of the piece, it will end up near the (I think) trailing edge, meaning that the piece is moving a little faster than the finger.

This is not a big issue, as the kids rarely make long slides, but it causes the demos to appear just slightly off.

Peter

jtse commented 12 years ago

I think I understand the problem. Basically, I need to track the point of contact (finger to the object) and use the displacement of the finger to determine the location of the object.

pgerhardstein commented 12 years ago

That is likely the solution. This may also address part of the issue w. the kids (part of it is that they just cannot touch with any precision, which isn't fixable through the software...)

Thanks,

Peter Gerhardstein
Associate Professor Dept. of Psychology
Binghamton University Binghamton, NY 13902 (607) 777-4387 (607) 777-4890 (fax)

On Aug 3, 2012, at 10:21 PM, Jim Tse wrote:

I think I understand the problem. Basically, I need to track the point of contact (finger to the object) and use the displacement of the finger to determine the location of the object.


Reply to this email directly or view it on GitHub: https://github.com/jtse/puzzle/issues/1#issuecomment-7498522

jtse commented 12 years ago

It looks like a median filter for mouse events is all we need. Please download and test it on the touch screen.

I had to restructure the event handling quite a bit but it should be much more flexible. The median filter size is configurable via the script file variable:

median-mouse-filter-size=N

where N is a odd positive number. The default is 11. Larger filter size means smoother mouse events but at a cost of responsiveness. For example, let's say the window size is 5 and the mouse Y events are:

Time -4: 300 Time -3: 301 Time -2: 299 Time -1: 302 Time 0: 1000

The program will see a mouse Y of 301 because it is the median.

pgerhardstein commented 12 years ago

Jim,

We will do this today.

Peter

On Aug 17, 2012, at 11:15 PM, Jim Tse wrote:

It looks like a median filter for mouse events is all we need. Please download and test it on the touch screen.

I had to restructure the event handling quite a bit but it should be much more flexible. The median filter size is configurable via the script file variable:

median-mouse-filter-size=N

where N is a odd positive number. The default is 11. Larger filter size means smoother mouse events but at a cost of responsiveness. For example, let's say the window size is 5 and the mouse Y events are:

Time -4: 300 Time -3: 301 Time -2: 299 Time -1: 302 Time 0: 1000

The program will see a mouse Y of 301 because it is the median.

— Reply to this email directly or view it on GitHub.