How to "wrap" a texture around a mesh
Hello everybody,
I started exploring using Kinect following this great thread: https://cycling74.com/forums/open-kinect&page=2
I added a simple depth control, so I can just grab figures excluding the background.
But now I have a big doubt about textures and the jit.mesh object.
Let me attach an image to explain what I would like to do:
So, that's me, grabbed by this patch:
trying to see the Mona Lisa "wrap" around my body, but actually just obtaining some sort of "masking".
And here comes the question: can I have the desiderd effect with jit.gl.mesh? Or should I try to follow a different path? Maybe jit.gl.nurbs? But how to obtain the right controlmatrix starting from camera grabbing?
What exactly do you mean "wrap" around? If you want parts of the mona lisa figure to map to similar parts of your body, you'll need to match texture coordinates on the mesh with corresponding locations in the image. For example, for the eyes to match up, you'll have to put texture coordinates over the vertices in the mesh where your eyes are that pull from the location in the mona lisa image where your eyes are. Since you're moving in front of the kinect, this location in the mesh will change, so you'll have to constant update the texture coordinate matrix accordingly.
Hello Wesley, thanks for your explanation.
Actually, I'd just like to see the texture resize around the body. So I'm making some (unsuccsessful) attempts to feed the mesh with the correct texcoords, but I still don't get it.
Could this be a correct approach?
check my reply to this post over here:
https://cycling74.com/forums/converting-video-into-geometric-abstractions
you can simply replace the live camera input with the kinect input.
I'm so sorry to bother you again, but it seems I'm not finding a way out.
What I'm trying to do is obtaining this kind of effect:
Ok. Sorry, I clicked on "Send Post" at the wrong time!
Anyway, I was talking about the "texture wrap" effect which I'm trying hard to obtain.... I'm attaching a picture just to clarify. It's just a jit.gl.gridshape with an attached texture.
So, as I said above, I'd like to achieve the same effect on a mesh that has the shape of a body. Like having a big piece of paper wrapped around the body. As Wes wrote, I need to generate a texcoord array that changes following the movement of the body, but I'm still stuck on that. What I got so far (se patch above) is always some sort of "magnifying glass effect", in which the body reveals and deforms a static image.
If I understood correctly I should try to get the correct texcoord from the depthmap of the kinect, but I can't get this part to work.
Please correct me if I'm wrong and forgive my stubbornness.
Yes, for each row of vertices you get from the kinect, you need to figure out where the body starts and put an x texture coordinate of 0. When you reach the end of the body, you need to put a 1 and interpolate in between. I don't have a kinect, so I really can't help by testing your patch. If you uploaded a matrix file containing the geometry that would make your patch testable by those who don't have kinects.