I am writing a flash app for an LED floor using a Kinect to track tuio points. The interactive is split into three zones. When a particular zone has more tuio points than any other zone, it will send a message to another application which triggers a photostream (not important right now)…
I am wondering what the best way to count these points would be. Would three different containers do it? If so, how is it that each container could effectively “contain” the points. I was thinking of drawing three different Rectangles and creating some kind of function that counts the points within the coords of each rect. I just can’t really wrap my head around how to keep certain points married to a specific region or DisplayObject.
Any thoughts? Thank you…
Placing points inside another container is like putting marbles inside balloon; the points will move, but the boundaries of the balloon will stretch to accomodate the marbles. Unless this is the behavoir you’re looking for, don’t parent the points to your rectangles.
Assuming a specific layout of rectangles, your goal is to count the number of points overlapping each rectangle. While you could certainly go the route of Geometry/Trigonometry calculations to ascertain an overlap (if your geometry were more complex, such as triangles, or n-sided objects), you could probably just get away with a framestack using getObjectsUnderPoint() & Point object..
Check the array for each of the 3 regions, and you’ll have your answer. 🙂