[Bf-python] formulas for Armature deformation

Chris Want cwant at ualberta.ca
Fri Jun 6 15:24:27 CEST 2003


The function that creates the display list for a mesh
that is deformed by and armature is object_deform
in source/blender/blenkernel/intern/lattice.c.
This is basically an entry point that calls
a bunch of stuff from
source/blender/blenkernel/intern/armature.c.
A quick skim through the functions in those
files show that the algorithm used is quite
close to what you describe, and in fact you
could probably just reuse the function
calc_armature_deform for your work.

Regards,
Chris


Jacek Popławski wrote:
> I was trying to imagine what will be needed in character animation exporter. I
> am interested how to display animation in 3D engine, so I need to know formulas
> to calculate mesh after armature deformation.
> 
> I understand that vertex has it's "static" position in mesh. Vertices are in
> any number of vertex groups, and have weights. Bones have their position and
> orientation.
> 
> I think to calculate final position one need to use loop like:
> 
> position=vertex.StaticPosition;
> for(i=0;i<ngroups;i++)
> {
>  position+=bones[i].influence*vertex.weight[i];
> }
> 
> 1) Am I right? Or is forumula completly different?
> 2) How to calculate influence? Is it just position (or change from initial
> position) of some point laying on bone?
> 3) What data will be available in Armature module? Will orientation of bones be
> in world space or parent space?
> 





More information about the Bf-python mailing list