jit.gl.meshwarp - possible to first reposition vertices without warping?

pseudostereo's icon

Just rediscovering jit.gl.meshwarp (which is fantastic).

I'm wondering if there would be any way to first drag the vertices to points of interest in the image – without warping it – and then, once I've got the vertices where I want them, drag them around with the image contents following (that is, the default behavior)?

For example, imagine that I have an image of a house with a background that I want to distort precisely. Since the meshwarp vertices fall on a regular grid, none of them are likely to fall on the corners of the house, So I can only drag points that fall either on the background, or inside the perimeter of the house.

As far as I can tell, this isn't currently possible with jit.gl.meshwarp. If anyone can give me a hint how to implement this, I'd appreciate it.

Federico Foderaro's icon

Interesting problem!
I think it should be possible by having two meshwarp, one for the points of interest and one for the actual image.
The only problem would be that if you click on one the other will disappear.
Maybe by rendering one to a node and videoplane and blending it on top of the other.
Let me know if you get stuck I will try to make a patch for this

pseudostereo's icon

Thanks Federico. Sounds good, but I don't have any idea how to implement what you're suggesting. If you could give me a few more clues (or better yet, throw together a quick demo patch) I'd very much appreciate it.

Federico Foderaro's icon

Will get to this in a couple of days, currently on vacation : )

pseudostereo's icon

Hi Federico - just a gentle nudge - I'd really appreciate it if you could make an example patch - or even just point me in the right direction -

Federico Foderaro's icon

Hi Pseudostereo, forgive me for the delay.
I have discovered that this is not possible yet with jit.gl.meshwarp out of the box.
I am working on the object to make this kind of interaction possible.
Thank you very much for your feedback

pseudostereo's icon

Hi Federico – thanks anyway - but do let me know if you manage to come up with anything - & if I can help in any way just ask

Vincent Goudard's icon

That would be useful indeed!

Facing the same question, I came up with using a mesh resolution high enough and mask a static mask for the static part.

Demo attached if useful to anyone.




meshwarp-static.zip
zip