? Multi-touch ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
[Help Wanted] SmileBASIC Documentation Project

Multi-touch

Submitted
Updated
Author
MZ952
Public Key
WDEE2D
Min. Compat.
All
Rating
7 votes
Description Uses ranging algorithms to filter through the random noise created when two, or more fingers are touching the screen and approximates the general location of both fingers. It's a rather simple idea. When the touch screen tries to coordinatize two or more touch inputs, it can't because of hardware limitations, and it instead returns a point that is the midpoint between all the touch inputs. If you monitor the returned point over several frames, the point moves erratically between the two touch inputs (given that they do not apply too much pressure), and by using ranges, you can determine, with some precision and accuracy, the general location of both the fingers. It detects a two finger input 70-80 percent correctly, and it has something like a 60 percent success rate when reading two fingers, however it is much better at determining the angle produced than it is the locations. Instructions Touch the screen gently with both fingers for best effect.
Categories
Keywords
7 Comment(s) Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies This is brilliant. I got this idea a few years ago, but was never able to translate the thought into code, which you seemed to do very nicely. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies I've really advanced this program since I published this. This algorithm refreshes the coordinates every single frame, which is not necessary considering most folks cannot twist their wrists faster than the speed of sound. So instead, I've rewritten it so that it does not change the touch coordinates unless the program sees it logical that the new set of coordinates it thinks it detected is correct or accurate. Still, fairly simple mathematics. It seems to me that some folks (who've commented thus far) have difficulty using this method for reasons unknown. I've speculated that perhaps some touch screens which are worn cannot take advantage of the method this program uses to detect multi-touch. If that's the case, progressing this project any further is utterly pointless for anyone except myself. Just so I know I'm not just wasting my time on this method (which I may implement into a future program), does this program work for anyone else? XSCREEN 3 DISPLAY 1 WHILE 1 TOUCH OUT TM,TX,TY IF TM THEN GPSET TX,TY,#WHITE ENDIF WAIT GCLS WEND Or when you run this code and touch the screen lightly with two fingers, does it produce an oscillating pixel between your fingers? All that's needed for this program to work correctly is for the pixel to occasionally move between your two fingers; the mathematics can somewhat predict what's going on in between those frames when the pixel does not move so frequently. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies I would also like to point out that this idea has applications for pressure sensitivity detection. 12Me21 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Yeah, I think I experimented with pressure detection in PTC, but I couldn't think of a use for it. kenchic kenchic Avatar Taboo I didn't change my avatar for 180 days Website Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself It looked much, much worse on my actual 3DS. It always got anything that was moving as two touches, and I guess you can't do anything about that. But I never got circles for more than one finger I put on the screen, and that kinda let me down a bit. But with some work, it could probably maybe happen? MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies Actually, there's a lot that can be done about moving being recognized as two touches. This is just a rudimentary demonstration, I'm sure someone with far superior mathematical capabilities could implement this idea better than I can. What kind of 3DS do you have? This could be dependent on the condition of your touch screen. My N3DS is new and fairly unused. Generally, you want to tap lightly with two fingers on the touch screen. Tapping works best. Give it minimal input so that the touch screen returns a series of varied inputs between the two touches, however without letting go of the touch screen. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies Run this kind of code: XSCREEN 3 DISPLAY 1 WHILE 1 TOUCH OUT TM,TX,TY IF TM THEN GPSET TX,TY,#WHITE ENDIF WAIT GCLS WEND and figure out what kind of ways you can touch the touch screen with two fingers to get the white dot to move the most erratically, then use the same methods on my program.