2
\$\begingroup\$

I am not interested in using easy libraries like assimp which will import collada files with ease to get skeleton animation done.

I wanna know what is the minimal requirement to get the animation done.

What I understand is that a bone is a 3*3 rotation matrix which is associated with each group of vertex.

We have to augment it with the model matrix to animate anything

How would I play a sequential animation with my existing bone system.

What's the workflow to process the bones. Sending bones through Uniform block is slow but I would consider doing it.

What's the simplest file format to store rig and animation data. Collada is unnecessarily advanced and complex.

Or how would I write my own file format for animation.

I am using blender to model and rig. How would I even manage to get an exporter for my format in blender

\$\endgroup\$
4
\$\begingroup\$

Those are 3 questions:

  1. How to implement a simple skeletal animation in OpenGL
  2. What is the simplest file format to store skeletal structure and animation data
  3. How to import from Blender to OpenGL

I will focus on the main question and just add notes for the 2 others:

How to implement a simple skeletal animation in OpenGL

An simple skeletal require:

  • A simple bone could be a transformation matrix. Which apply a rotation and translation.
  • A bone apply to a set of vertexes
  • A bone effect on a specific vertex is weighted between 0 and 1. To avoid strange effect on articulations.

A very simple way to solve that in OpenGL is:

  • Every frame, update and save in an uniform vector each bones transformation matrix, ordered so a leaf is always after a root.
  • Each vertex in the VBO contain, not only its position and normal, but also a list of weights of the size of the bone vector.
  • In the vertex shader, for each bone, weight the bone matrix and apply it. So unrelated bones will multiply by the identity matrix, and relevant will have a real effect.
  • Several optimizations are possible

Short answer about file formats:

There are plenty of file-formats which accept bones, and to suggest one or another depends mostly of your specific requirements. I suggest you to look for:

  • Support bones, at the complexity you want.
  • Is not over-complex neither missing important features.
  • The format is documented and, ideally, standardized.

Blender native format is, however, generally not a good idea: the format is not formally defined, so it is difficult to implement an exporter (except by just copying the loading code).

Creating your own format is possible and quite easy: You may create a script in blender to export and load it in your application.

EDITED 1:

Requirement of data for a "correct" skeletal file format:

  • Bone hierarchy
  • Affected vertex per bone, or
  • Bones influence range, or weight per vertex.
  • Articulation axes, and angular limitations to every one
  • Animation of bones:
    • Allows several animations (e.g. one for walking, another for jumping...)
    • Definition of bone movement per animation.
    • Timing for the animation.
\$\endgroup\$
  • \$\begingroup\$ Considering that your question is very broad, I did my answer also very broad (does not make sense to extends technics that you will maybe not like). Tell me, or ask a new question if you want more details on a specific topic. \$\endgroup\$ – Adrian Maire Nov 16 '16 at 13:39
  • \$\begingroup\$ What are the minimal components of skeletal animation file format \$\endgroup\$ – Yashwanth CB Nov 16 '16 at 16:10
  • \$\begingroup\$ @YashwanthCB: Added some hints, but some more complex animations could require far much. \$\endgroup\$ – Adrian Maire Nov 16 '16 at 16:26
  • \$\begingroup\$ Robotic animation is enough for me \$\endgroup\$ – Yashwanth CB Nov 16 '16 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.