How to know if point is inside areas/shapes (Kinect)

Feb 24, 2013 at 3:51pm

How to know if point is inside areas/shapes (Kinect)

I’m using Kinect to control some musical parameters. I would like to have my hand, a point in space, touch an area shaped like a rectangle to trigger something. How do I go about making a patch that knows when a point is inside/outside a simple shape in a 2D plane (better yet 3D!)?

#66698
Feb 24, 2013 at 3:53pm

Similar to this: “How determine if a trapezoid contains an x,y pair?”

http://www.cycling74.com/forums/topic.php?id=5366

#240064
Feb 24, 2013 at 4:24pm

Hi,

In max5 there is an example “jitter-gui-sliderexample.maxpat” with javascript and jitter.

( max5/examples/jitter-examples/javascript/ui/itter-gui-sliderexample.maxpat )

HTH

#240065
Feb 25, 2013 at 7:27pm

a google search for “determine if point is inside polygon” returns the following:

http://alienryderflex.com/polygon/

#240066
Feb 26, 2013 at 5:46am

So I spent all of today making this patch to detect when a point is inside a specific shape in a 2D plane. This is useful for any type of 2D interaction that needs to have objects respond to the location of a finger, mouse, pen, light, etc… You can create multiple shapes that are individually triggered when touched. I do this by polling the color of the x,y point on the LCD object and assigning RGB values to indexes.

Right now I’m using it to create a virtual drum kit to be played with kinect.

Would love to do this in 3D but my skills with jitter are limited!

#240067

You must be logged in to reply to this topic.