Forums > Jitter

Playdough Mesh

January 2, 2007 | 6:24 am

Hi everyone,
There was some talk a few weeks ago about vertex skinning. Here’s a
patch that demos the technique. It’s a little hairy, especially the
vertex shader, but it does work. This patch is not completely error
free yet. For some reason the vertex interpolation is squishing
segments together and I haven’t figured out why, but I think the idea
still comes across.

Here’s how it works:
I’ve divided the mesh into 5 sections, each controlled by the position
and rotation (modelview matrix without the scale) of a gridshape. I
generated a cylindrical mesh and assigned each vertex to a section
(bone in the vertex skinning terminology) and a weight. The weight
says how much a given vertex is affected by a particular bone.
Getting all this data into a vertex shader is a bit tricky. Here I
put the weights in the texture coordinate matrix and the bone
assignment in the tangents matrix. This choice was for convenience
but is not the only way to do it.

The trickiest part of this whole business is getting the modelview
matrix for each segment ( aka the bone matrices) into the shader. To
conserve space, only the rotation and translation portions of the
matrix are sent which ends up being a 3×4 matrix. In the shader,
these are stored as an array of vec4s. For convenience, I actually
send the transpose of the 3×4 bone matrix so that a row of the matrix
is stored in a single vec4. Again, this isn’t the only way to go. In
the shader, I build a modelview matrix from this data and use it to
find a new position for the vertex.

Theoretically, all of this data could be generated in Maya. Maya has
really nice tools for building skins and bones for a mesh, but the
m********* f********* has really lame export facilities. I tried
about half a dozen plugins that supposedly export skin and bone data
but none of them worked. If someone knows how to do this, I would be
most grateful to know how.

Here’s the link.

http://www.mat.ucsb.edu/~whsmith/PlaydoughMesh.zip

best,
wes


January 2, 2007 | 6:59 am

hmm – Wes, when I hit initMesh, I get an instant crash

OSX 10.4.8 Intel macbook pro
max 4.6.2
jitter 1.6b2

On Jan 2, 2007, at 1:24 AM, Wesley Smith wrote:

> Hi everyone,
> There was some talk a few weeks ago about vertex skinning. Here’s a
> patch that demos the technique. It’s a little hairy, especially the
> vertex shader, but it does work. This patch is not completely error
> free yet. For some reason the vertex interpolation is squishing
> segments together and I haven’t figured out why, but I think the idea
> still comes across.
>
> Here’s how it works:
> I’ve divided the mesh into 5 sections, each controlled by the position
> and rotation (modelview matrix without the scale) of a gridshape. I
> generated a cylindrical mesh and assigned each vertex to a section
> (bone in the vertex skinning terminology) and a weight. The weight
> says how much a given vertex is affected by a particular bone.
> Getting all this data into a vertex shader is a bit tricky. Here I
> put the weights in the texture coordinate matrix and the bone
> assignment in the tangents matrix. This choice was for convenience
> but is not the only way to do it.
>
> The trickiest part of this whole business is getting the modelview
> matrix for each segment ( aka the bone matrices) into the shader. To
> conserve space, only the rotation and translation portions of the
> matrix are sent which ends up being a 3×4 matrix. In the shader,
> these are stored as an array of vec4s. For convenience, I actually
> send the transpose of the 3×4 bone matrix so that a row of the matrix
> is stored in a single vec4. Again, this isn’t the only way to go. In
> the shader, I build a modelview matrix from this data and use it to
> find a new position for the vertex.
>
> Theoretically, all of this data could be generated in Maya. Maya has
> really nice tools for building skins and bones for a mesh, but the
> m********* f********* has really lame export facilities. I tried
> about half a dozen plugins that supposedly export skin and bone data
> but none of them worked. If someone knows how to do this, I would be
> most grateful to know how.
>
> Here’s the link.
> http://www.mat.ucsb.edu/~whsmith/PlaydoughMesh.zip
>
> best,
> wes

v a d e //

http://www.vade.info
abstrakt.vade.info


January 2, 2007 | 7:29 am

Don’t hit init mesh then. It gets called on loadbang anyway. Just
turn on the metro. I was getting alot of crashes as well with this
patch but it worked on my macintel imac with jitter b3.

wes

On 1/1/07, vade wrote:
> hmm – Wes, when I hit initMesh, I get an instant crash
>
> OSX 10.4.8 Intel macbook pro
> max 4.6.2
> jitter 1.6b2
>
>
>
> On Jan 2, 2007, at 1:24 AM, Wesley Smith wrote:
>
> Hi everyone,
> There was some talk a few weeks ago about vertex skinning. Here’s a
> patch that demos the technique. It’s a little hairy, especially the
> vertex shader, but it does work. This patch is not completely error
> free yet. For some reason the vertex interpolation is squishing
> segments together and I haven’t figured out why, but I think the idea
> still comes across.
>
> Here’s how it works:
> I’ve divided the mesh into 5 sections, each controlled by the position
> and rotation (modelview matrix without the scale) of a gridshape. I
> generated a cylindrical mesh and assigned each vertex to a section
> (bone in the vertex skinning terminology) and a weight. The weight
> says how much a given vertex is affected by a particular bone.
> Getting all this data into a vertex shader is a bit tricky. Here I
> put the weights in the texture coordinate matrix and the bone
> assignment in the tangents matrix. This choice was for convenience
> but is not the only way to do it.
>
> The trickiest part of this whole business is getting the modelview
> matrix for each segment ( aka the bone matrices) into the shader. To
> conserve space, only the rotation and translation portions of the
> matrix are sent which ends up being a 3×4 matrix. In the shader,
> these are stored as an array of vec4s. For convenience, I actually
> send the transpose of the 3×4 bone matrix so that a row of the matrix
> is stored in a single vec4. Again, this isn’t the only way to go. In
> the shader, I build a modelview matrix from this data and use it to
> find a new position for the vertex.
>
> Theoretically, all of this data could be generated in Maya. Maya has
> really nice tools for building skins and bones for a mesh, but the
> m********* f********* has really lame export facilities. I tried
> about half a dozen plugins that supposedly export skin and bone data
> but none of them worked. If someone knows how to do this, I would be
> most grateful to know how.
>
> Here’s the link.
> http://www.mat.ucsb.edu/~whsmith/PlaydoughMesh.zip
>
> best,
> wes
>
> v a d e //
>
> http://www.vade.info
> abstrakt.vade.info
>
>
>
>
>
>
>


January 2, 2007 | 7:42 am

lol.

On Jan 2, 2007, at 2:29 AM, Wesley Smith wrote:

> Don’t hit init mesh then. It gets called on loadbang anyway. Just
> turn on the metro. I was getting alot of crashes as well with this
> patch but it worked on my macintel imac with jitter b3.
>
> wes

Hey doc, it hurts when I do this

- then dont do that.


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