Forums > MaxMSP

controlling LCD Draw with Kinect

May 6, 2012 | 5:41 am

hi there,

I am currently working on a project that involves the use of an Xbox Kinect to control the LCD draw screen.

I have used Synapse to read my left and right hand positioning, I now need to use this data to control the mouse input on the screen.

Does anyone know how I would be able to go about this?


May 7, 2012 | 9:04 am

If you’re after drawing curved lines with LCD, then I think ( I may be wrong), the best/ only way is to use the setpixel message, for example:

[Kinect HandPosition]
| |
[pack f f ]
|
(setpixel $1 $2 255 0 0)
|
[lcd]

You will have to scale the kinect data appropriately for the LCD.

Could you explain your project a little further though? As I am too working on ‘painting’ with the Kinect, and maybe able to offer some advice.

-chris


May 7, 2012 | 11:15 am

basically the LCD will be used to control 3 different samples playback and pitch, the height of each line will determine the pitch and the length of each line will determine the length of playback. so yeah the lines need to be curved I will give what you suggest a go.


May 7, 2012 | 12:05 pm

Well what I would suggest is that if the LCD isn’t being used for visuals, just for data storage/writing/reading, I would use the data straight from the Kinect, and scale it down to what you need, and if you need to store the gesture data, do it using coll, not LCD. If however yo want the LCD for visual aid in doing so, the above method will work, however I would not use the LCD as a data read back system.

Here is a thread around capturing gesture data: -

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

-chris


May 12, 2012 | 4:19 am

I decided to use the kinect to hijack the mouse using the mxj Autobot. The problem I now have if the vertical movement is not in sync, what I mean is when I rase my arm up the mouse goes down. any idea of how to alter this?

Cheers

Jack


May 12, 2012 | 9:37 am

Not sure if i understand your problem fully but if all you want to do is draw then why not just pack a line line to $1 $2 you could even use the z axis to control the weight. I haven’t scaled the patch so you will need to add that.

Attachments:
  1. kinectlcd.maxpat

May 12, 2012 | 3:05 pm

So you need to reverse the Y axis yes?

Well If what I think is happening is happening, you’re getting increasing values from the Kinect (raising your hand).

The thing about the mouse is, it’s values start from 0,0 (top left corner), to 1400,900 (bottom right corner). So if the value from the Kinect is going up, it will in fact move the mouse down, (what it sounds like you’re experiencing).

Resolution: -

- run all the Y axis data through a [* -1] object, this will flip the values.
- you then need to scale these values accordingly using the scale object. example:

Averagely, the data from the kinect ranges between -1000 to 1000. And your computer screen resolution, (what your mouse goes off), is 0-900. So what we want is a scale object like so-

[scale -1000 1000 0 900]

(first two values are the Kinect range, second two values is your screen resolution range which will change depending on your resolution).

Does that help?

-chris


May 13, 2012 | 11:05 am

thanks chris I have managed to use the scale object to correct the Y axis! my project is almost finished! thanks for your help!


May 13, 2012 | 11:13 am

No problem, if you have any videos/ links about it when you’re finished post it in this thread, I wouldn’t mind seeing what you’ve been up to.

-chris


Viewing 9 posts - 1 through 9 (of 9 total)