I’ve playing with a lot of motion/gesture detection in flash lately, and this week I got into some shape detection based on user input. In this demo, I used the “difference” blend mode to compare the user’s drawing with a bunch of vector shapes that I’ve baked in to the swf file.
Press down, drag, and release when your doodle is done. Try to draw the 4 shapes and test out its accuracy.
When you release the mouse, the shape it detects should light up, if it doesn’t recognize it then none of the 4 shapes should light up. What I like about this method is that you don’t need to “close” the shapes you draw. You can draw a spiral and it should detect that it’s a circle.