PDA

View Full Version : Need help in skinning a skeleton

 Ravikant05-10-2011, 12:37 PMHi, I need some help regarding the skinning equation given in COLLADA specs. I have all the information regarding skin vertices (their positions, normals, and their weights associated with different joints) and skeleton in my openGL code. Equation is: outv = summation over all i {[(v * BSM) * IBMi * JMi] * JW} ////////////////////////////////////////////////////////////////////////////////////////////////////// Assuming: 'v' is a 1x4 matrix containing homogeneous coordinates of a vertex. v = [v0, v1, v2, v3] BSM is 1x16 array representing skeleton's bind shape matrix in row-major format BSM = [a0, a1,...a15] IBM is 1x16 array representing joint's inverse bind pose matrix in row-major format IBM = [b0, b1,...b15] JMi is 1x16 array representing joint's world matrix in row-major format JMi = [c0, c1,...c15] JW is a floating point value representing the weight with which 'i'th joint affects vertex v. n is the 1x4 array representing the normal corresponding to vertex v n = [n0, n1, n2, n3] ///////////////////////////////////////////////////////////////////////////////////////////////////// In this I have following questions: q1: Are BSM, IBM and JMi column-major or row-major matrices? (I think COLLADA documents contain matrices in row-major order. Please correct me if I am wrong) q2: Initially v3 = 1, but after doing these multiplications it may not remain 1. So what should I do in this case? Should I divide all the other values, i.e. v0, v1, v2, by v3 ? q3: Right now I am multiplying matrices in the following order. temp1 = v*BSM temp2 = IBMi*JMi temp3 = temp1*temp2 where matrices are as specified above in assumptions. Is this order correct or there is some mistake related to pre-multiplication or post-multiplication? q4: What would be the transformation equation of normal 'n'? ///////////////////////////////////////////////////////////////////////////////////////////////////// I have tried many permutations and combinations but my skinning is not getting done correctly. Kindly reply ASAP. Also if you know about some other better way of doing skinning then please let me know. Any help is appreciated. Thanks & Regards, Ravikant Bhargava, Final Yr. student, Department of Computer Science, IIT Delhi, India.
CGTalk Moderation
05-10-2011, 12:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.