2
votes

I am trying to implement animations in OpenGL but I don‘t really understand the inverse bind pose matrix. As far as I understand it, this matrix is used to ‚revert‘ any previous deformations applied to my vertices. But why would I even need that? Why can‘t I just pass the positions of my vertices that I loaded from the file to the GPU and apply the bone‘s rotation ans translation without any additional calculation? The GPU won‘t modify the vertex positions on the client side so I don‘t think I would have to revert any previous transformation, right?

1

1 Answers

4
votes

Mesh vertices are defined in object space. To apply bone transformation correctly vertex must be in bone local space. So, a pose is applied in two steps:

  1. Transform vertex from object space to bone space (inverse bind pose matrix)
  2. Transform vertex from bone space to "animation" space (bone matrix from animation)

Also, you can't pre-transform vertex to bone space 'cos (usually) vertex affected by more than one bone. (Thanks to Nicol Bolas)