Insert skeleton in 3D model programmatically

Software: Away3D 4.x

Yann, Newbie
Posted: 04 September 2015 03:59 PM   Total Posts: 16

Hello everybody!

I need a little advice. I’m trying to animate a pathExtrude object. For now, I’m simply calculating the vertex position (CPU) and updating them using updateVertexData(). But it doesn’t seem very efficient.

Someone advised me to use the vertex animator from prefab to generate “keyframes” and let the engine interpolate between each frame. It sounds more efficient but it means having a big database of the different positions for each vertex, and I’m afraid of memory issue.

A third solution came to mind: a skeletonAnimator. I would have to
  1) Create a path
  2) Build a skeleton fitting to this path
  3) Extrude the mesh following this path ( around the skeleton)
  4) “attach” the mesh to the skeleton
  5) Build a database of the different positions (SkeletonClipNode?)
  6) Animate the skeleton manually

I believe this would reduce the number of data stored in the memory and keep the advantage of the GPU rendering… but I’m not sure. And I can’t find any tutorial/example/info regarding the point 4, 5 and 6 (specifically the point 4, I couldn’t find anything about rigging in away3d)

Which solution is the best one? Is there any other solution?

   

Avatar
Fabrice Closier, Administrator
Posted: 04 September 2015 06:44 PM   Total Posts: 1265   [ # 1 ]

Prefab’s vertex animation will be efficient, it will not consume that much if you are smart for the keyframes. for instance going from straight line to almost u, to u would allow you to bend without much visual distorts while straight to u would be ugly. Having like 10 keyframes would be overkill. Remember that vertex animation is a linear thing and keyframes are very important to mimic arcs. Memory side, if you have a huge amount of vertices and many keyframes it will of course have an impact. I’d say, try and see how that goes, because that’s probably the most easy option.

Programming a skeleton animation with loads of bones if your profile is complex, get the weights right etc… fun in perpective. Of course all depends of the path complexity and profile.

The most efficient to me if you are familiar with AGAL would be a fourth solution: write a vertex shader that animates the vertices along the bezier.

   

Yann, Newbie
Posted: 04 September 2015 11:32 PM   Total Posts: 16   [ # 2 ]

Thank you for your answer !

The path and the animation data come from a simulation tool which provide detailed data. So I have a lot of vertex and keyframes: My issue is not to mimic arc properly, but it’s more related to the memory and performance (framerate).

As the Path Extrude class generate a “profile” at each node of path, I believed I could generate a skeleton joint at each path node location, and bound each “profile” to the corresponding joint. (weight =100% I guess). English isn’t my native language so it’s hard to be clear.

Basically this would limit the amount of animation data (one joint moving all the vertex of the profile at this location) and allow me to change the profile without impacting the animation data. I would be able to attach other meshes etc…

But, regarding the performance, I’m not sure that it is better than the vertex animator, and I dont know how to programmatically link a vertex to a bone.

Unfortunately I’m not familiar with anything , Neither AGAL nor the vertex shaders.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X