Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 15 Jan 2013
Offline Last Active Mar 26 2013 02:18 AM

Topics I've Started

Skinning Problem

15 January 2013 - 12:46 PM

I have some problems with skinning. So, here are the steps i have done to perform skinning.

- When exported, all vertices are already in the reference pose.
- All bone transformations are absolute transformation. (Not relative to parent)
- bone offset matrix = inverse (bone transform matrix)
- bone matrix = bone matrix * inverse (parent bone matrix)

- bone.transformMatrix = bone matrix (as exported)
- Loop through each bone
bone.absoluteMatrix = bone.transformMatrix * parentBone.absoluteMatrix

- Send bone.absoluteMatrix as the bone matrix to the GPU
- Send bone.offsetMatrix (as exported) as the bone offset matrix to the GPU

for each vertex
vec4 tempVertex = [0, 0, 0, 0]

for each bone influencing this vertex
boneMatrix = boneMatrix[this bone] * boneOffsetMatrix[this bone]
tempVertex += (vertex * boneMatrix) * weight[this bone on this vertex]

tempVertex /= total weight

final vertex position = projection Matrix * view matrix * world matrix * tempVertex

So, the skinned mesh is not being rendered correctly and i am not being able to spot the problem but i know the problem comes from the matrices. The weights and bone influences are all right. Any1 can help please?