PositionMesh Problem with animated B3D

Blitz3D Forums/Blitz3D Programming/PositionMesh Problem with animated B3D

jfk EO-11110(Posted 2006) [#1]
I just found a bug in my code. While PositionMesh works ok with animated 3DS files, it completely distorts animated B3D.

I alread tried to use a recursive function that will apply PositionMesh only on Children that are of EntityClass$ "Mesh", but didn't work.

Is there an other way to permanently translate an animated mesh, as PositionMesh does?


b32(Posted 2006) [#2]
The distortion has to do with the bones, that are still in their original position. I've tried to apply PositionMesh on Class="Mesh" objects and PositionEntity on the rest, however the model was still distorted.
I think some bones are affecting the entire model and some other bones are only relative to other bones. Did you consider using PositionEntity on the entire model ?
If you want to move the animated model to combine it with other models, you can stick them together on a parent bone maybe. Maybe you could create new animation keys, and move them ?
This code adds a pivot as a parent to the animated mesh, and then creates new animation keys, including the parent pivot. Finally you can call "animate" on the pivot instead of the mesh.



jfk EO-11110(Posted 2006) [#3]
As you suggested I'm using a pivot now, works ok. Thanks a lot!