swaying grass with kinect

zulli114's picture

I am looking to try and simulate grass moving when someone walks by. I am not really sure how to go about doing that. I was looking at 1024 rope example thinking I might be able to move that. Any ideas would really help.

dust's picture
Re: swaying grass with kinect

i use mesh files with some noise to simulate a swaying type effect.... here is a basic grass sway patch that utilizes mesh bending and mesh noise to simulate swaying. this way one could use skeleton or head tracking to to make the grass bend in the direction of the movement. also one could just use the depth image from a kinect to detect if a person is a certain distance away and thus triggering the noise to simulate swaying. i made an automation switch where the grass auto sways and a manual switch where you can feed a -1 to 1 x coordinate stream from the kinect or head tracking etc... to make the grass bend in the direction of the movement. its just a single clump o grass but you can place it inside an iterator to populate a floor with grass. see this patch in the repo to get an idea of how that is done... http://kineme.net/composition/dust/grassscene

certainly you could use a 1024 rope type of physics simulation. I'm not sure if the 1024 rope works inside an iterator though. you could also try a spring chain... http://kineme.net/composition/dust/springchain also search the forum for fur. there is a glsl patch laying around that could be modified to sway.

what form of input are you using for the kinect.

PreviewAttachmentSize
clumpO'Grass.zip194.85 KB

zulli114's picture
Re: swaying grass with kinect

Thanks so much for the input. I was using the basic kinect library from kineme for now, I am not sure how I would connect that to the grass. You mentioned a -1 to 1 x coordinate stream from the kinect or head tracking, I am not sure what you mean. It gives me depth image/color image. How would I detect the distance they are at?

zulli114's picture
Re: swaying grass with kinect

I am not seeing anything it only opens with gradients. see attached

PreviewAttachmentSize
grass.jpg
grass.jpg24.47 KB

dust's picture
Re: swaying grass with kinect

try this patch. let me know if it loads up... you need to keep both the .dae and .qtz file in the same folder. if you still can not see grass manually add the mesh file buy dragging and dropping onto the editor. i was thinking you might be sending in a skeleton data stream to qc via osc from ni-mate or something like that. i have a kinect patch laying around somewhere that will help you detect if someone is at a certain depth. there are also a few of these in the repo as well. let me know if you can load the clump o grass and we can take the next step after that.

PreviewAttachmentSize
clumpO'Grass 2.zip194.63 KB

dust's picture
Re: swaying grass with kinect

double post

zulli114's picture
Re: swaying grass with kinect

Bummer this still doesn't work. I opened the file in QC version 4.0 (103.1) on snow leopard. Didn't load and then I added it in by dragging and dropping to see if the file path would change. Still nothing. I have attached the photo. Maybe there is a plugin or patch missing. I do know in the grass demo someone said there was a issue with the DAE file. I do know I can't open that file with any program including preview. I even have maya on my computer still no go.

Love to see your kinect files too. Working on that at that same time.

PreviewAttachmentSize
grass_not.jpg
grass_not.jpg12.05 KB

dust's picture
Re: swaying grass with kinect

strange ? i exported the grass clump from maya as a dae/fbx file. i got some warning about my texture which is a phong shader gradient ramp. in preview i can see the clump of grass without the texture via dae file (see pic 1) but when loaded into qc and the qc file previewed with space bar (see pic 2)....i can see the grass with the phong shader ?

im still on the lion operating system. i exported the clump of grass again this time with just a simple color texture. i got one warning.... something about collada not liking nulls in the grass geometry. i previewed every thing and it looks fine (see pic 3). i zipped up the a dae file, a maya binary file and a obj file just incase you can not open the maya file.

again try and load this one up. tell me what operating system your using as well....

zulli114's picture
Re: swaying grass with kinect

So I opened your obj file in maya and re exported it and it works. How would I put this with a kinect? I was using just the basic kinect tools. Trying to figure out depth image with it. Is that correct? Just want it to move when a body comes across. Nothing fancy j

dust's picture
Re: swaying grass with kinect

here is a basic kineme kinect tools set up. first you need to set the near / far or min / max of the kinect camera. if there are no objects directly in front of the kinect keep the min at 0 and set the max to lets say point one. what this does is negate anything about a meter or so from the camera. once the participant is in range set by min / max... lets say once the participant is a meter or so from the camera it will trigger the grass to start moving once the participant moves out of that range then grass stands relatively still. this condition is achieved by detecting when there are pixels present. when pixels are present then the grass moves, when they are not present then the grass stands still.

PreviewAttachmentSize
Grass_Kinect.qtz111.7 KB

zulli114's picture
Re: swaying grass with kinect

thanks for the basic kinect uses. I re-loaded the grass in maya and it had no problems. I played with the iterator like you talked about and got a really good mix. It seems to be very funny about the dae files. Not sure why. The kinect path works great I am wondering if I can smooth out the depth lines of the kinect. They really seem to react to the bummpy reading of me. Also I am really stuck on the video piece I posted if you had time I love to hear what you think.

@dust have been a huge help and have been very evolved with this forum. Thank you very much. I am juggling a bunch of things and learning a bunch for school.

Thanks so much