baking mesh animations using point cache
i use the collada file format for importing 3d objects into my “system”.
nice thing of the collada file format is, it contains informations about animations.
but those animations are only for whole objects, not for vertex data.
if you use it for displaying robots or bone/skin stuff this is ok.
but you can not use it for baking complex animations created in 3ds max.
3ds max has the point cache modifier for objects.
this modifier exports baked and sampled animations to a file.
which is exactly the feature collada is missing.
so you can bake mesh animations for your object and read the exported files in your engine.
using the point cache modifier
1. create your animation using for example the twist modifier on an object
2. put the point cache modifier on top of the modifier stack
3. press record, enter file name and you are done
4. the button “disable modifiers below” you can turn of the animation modifier, now play the animation and you’ll se the sampled animation.
point cache pc2 file format
the exported pc2 files contain simple information about the animation and a big chunk of sampled vertex data.
i found a description of the format here
char cacheSignature[12]; // Will be 'POINTCACHE2' followed by a trailing null character. int fileVersion; // Currently 1 int numPoints; // Number of points per sample float startFrame; // Corresponds to the UI value of the same name. float sampleRate; // Corresponds to the UI value of the same name. int numSamples; // Defines how many samples are stored in the file.
this is the header information.
after that the vertex data follows as floats (3 floats for a vertex):
numSamples*numPoints*3