How to implement an animation in Optix

Dear developers,

I have a need to realize the assembly process of a model.

First,The data we have now are skeletal animation data.

Second, how to implement animation in Optix.

Third, can a simple demo sample be provided.

If the animation can be expressed by changing the matrix on a Transform node, you would simply put your individual GeometryGroups holding the GeometryInstances holding the Geometry and Material of your individual animated objects under Transform nodes and change the matrix at these transforms, then refit the top level acceleration structure and re-render for each animation step.

If you have a deep transform hierarchy in your application’s scene graph e.g. like a kinematic skeleton, it’s not recommended to use that same deep transform hierarchy inside the OptiX scene graph for performance reasons.
Instead your application should concatenate the effective transform matrix per object and use a flattened hierarchy in OptiX to get a two-level BVH with a top-level Group node and Acceleration and a single level of Transform nodes over GeometryGroups with Accelerations. That will render faster.

An example using Transform nodes for animations can be found inside the OptiX SDK example optixDynamicGeometry sources. Search the code for “setMatrix”.