Interactive Mesh Warping for 3D projection mapping (Composition by Scratchpole)

Author: Scratchpole
License: Public Domain
Date: 2013.02.16
Compatibility: 10.6
Categories:
Required plugins:
GLTools, alpha blend, _1024 structure tools, savexmlplugin

Display your mesh as an interactive structure. Move the vertices of the structure to fit your real world object. Save the new vertex structure,load it up and combine with the original .dae's UV coordinates.

Now all you need to do is make some compelling content to display on your model ;D

pyramus's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

Looking good, thanks!

One note: the composition actually appears to be using the deprecated _1024_InteractionStructure plugin, instead of _1024_Structure_Interaction from the new _1024 Structure Tools plugin (which you mention as requirement).

Scratchpole's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

Yep sorry about that. I also found it to be more reliable with Kineme File Tools 1.2 to write the structure.

I also encountered an issue I was not expecting.... Because you need to put the mesh within a GL Ortho environment in order to have interactive access to all the vertices the lighting environment will not operate as expected with shadows switched on.

I don't know if this is a bug with the Ortho patch? Maybe it is actually an expected behaviour as it is squashing the verts onto one z plane. Any ideas or suggestions?

jrs's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

I've done something similar using a shader to do the warping instead of moving verts - it means the lighting works fine but its not as flexible with the vert positioning (you're restricted to stretching things based on a bounding box) - I'd love to be able to post it but it was for work so unfortunately I can't release it :(

Scratchpole's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

:( GLSL shader? I previously used a CL routine which was not great because when vertices were moved close to each other they merged/disapeared, so it was unreliable.

jrs's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

yep GLSL - instead of working at the vertex level I just drew a bounding box around the source model and another around the target position, fed these into the shader and used a free form deformation to "stretch" everything accordingly. As all of the vertices, texture coordinates etc get changed relative to each other you don't end up with any glitchiness, or I didn't anyway.

dust's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

Looks sweet joe. I just fucked my system putting to much ram in it the other day and need to get my linemen and plugins sorted again, I'll get back to you when I get it running

Scratchpole's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

Sorry to hear that Dustin.

I got this working a bit better by loading the new structure outside of the Ortho, the lighting/shadows work now. Obvious problem being that if you interact with the ortho version and then display in perspective it won't fit so you have to toggle between views. Set a reference vertex (in the case of overlaying verts) in perspective view and switch to ortho in order to grab individual vertices easily.

I like the sound of your shader method jrs, sounds a bit like the GL Matrix Multi environment, but with draggable corners. I wonder if I can do something similar with _1024 structure tools bounding box...?

dust's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

thank god for kineme. i have no idea where savexml went ? sweet i got it running but mesh display crashes me because of gl tools ? does this happen with anybody else.

Scratchpole's picture
Re: Interactive Mesh Warping for 3D projection mapping ...

Yep crashy crashy. If you switch off the GL Structure before enabling the new mesh it works OK most of the time. Again this was sorted out by putting the new mesh/structure outside of the Ortho.