Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / Skeletal Animation and Surfaces... Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

March 25, 2005, 05:54 PM

So here's a puzzler...

I've got a skeletal animation system that is responsible for updating surface information as well as vert/normal positions. A surface is basically just a plane with edge info (indices to neighboring surfaces). At the moment I'm going with the easy to manage case where every surface represents a single triangle in the source mesh.

The problem is that although the code works fine, the surface stuff is ungodly slow. At the moment I just build a new plane based on the newly transformed verts, implying a crossproduct among other things. Has anyone else found a way to keep the surfaces current without having to do a hard rebuild every frame?



March 25, 2005, 06:20 PM

I suppose what you want is vertex/normal skinning?


March 25, 2005, 06:25 PM

I think you can represent the plane equation as a vector (ie Ax + By + Cz + D = 0 to [A, B, C, D]) and transform it by the inverse transpose of the matrix used for vertices. If you're not using nonuniform scaling, the inverse transpose will be the same matrix.


March 25, 2005, 09:59 PM

Sure, the tricky bit is figuring out which bone to transform the plane by. The skinning is a per-vert operation while surfaces are per-tri. I had originally intended to transform the planes in the same way that the verts are, but when it came down to it I couldn't find a good way to determine which bone to use for each face.


March 26, 2005, 12:28 AM

OK, I finally decided to create a list of surface bone binds when the mesh is loaded based on the child vert bindings. If all the children share the same bone the surface gets that bone. If they differ at all the surface is tagged to be rebuilt during animation.

The increase of 5 whole frames per second. Hmmm. Maybe I need to merge the loop where the verts are applied to the skeleton with the loop where the surfaces are applied.


March 26, 2005, 06:51 AM

Maybe you need to move skinning to the GPU (well after you've streamlined the code that is). You only need to work on a per-vertex level, the topology remains constant.


March 26, 2005, 09:34 AM

You should get rid of the normal, etc. information from the surface which changes under the skinning and store indices to vertices that defines the surface instead. Then you can choose one of the solutions below which suits your application:
1) perform skinning of vertices to a transformed vertex buffer and update the normal information of surfaces after that. reguides space for transformed vertices + surface normal.
2) perform skinning of vertices to a transformed vertex buffer and compute normal information in fly once it's needed for surface from transformed vertices. requires space for only transformed vertices.
3) compute skinning of untransformed vertices when you need information for a surface and compute the normal in fly while applying some small post-transform vertex cache to reduce redundant transformation work (this is the way GPU works). doesn't require any extra space except the one for the post-transformation cache.

Cheers, Altair

This thread contains 7 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.