c++ - Extracting skin data from an FBX file -


i need convert animation data autodesk's fbx file format 1 compatible directx; specifically, need calculate offset matrices skinned mesh. have written converter( in case converts .fbx own 'scene' format ) in calculate offset matrix mesh. here code:

// //  skin // if(bhasdeformer) {     // iterate deformers( todo: account multiple deformers )     for(int = 0; < ncdeformers && < 1; ++i)     {         // skin         fbxskin *pskin = (fbxskin*)pmesh->getdeformer(i, fbxdeformer::eskin);         if(pskin == null)             continue;          // bone count         int ncbones = pskin->getclustercount();          // iterate bones         (int boneindex = 0; boneindex < ncbones; ++boneindex)         {                                    // cluster             fbxcluster* cluster = pskin->getcluster(boneindex);              // bone ref             fbxnode* pbone = cluster->getlink();              // bind pose             fbxamatrix bindposematrix, transformmatrix;             cluster->gettransformmatrix(transformmatrix);             cluster->gettransformlinkmatrix(bindposematrix);              // decomposed transform components             vs = bindposematrix.gets();             vr = bindposematrix.getr();             vt = bindposematrix.gett();              int *pvertexindices = cluster->getcontrolpointindices();             double *pvertexweights = cluster->getcontrolpointweights();              // iterate through vertices, affected bone             int ncvertexindices = cluster->getcontrolpointindicescount();              (int ibonevertexindex = 0; ibonevertexindex < ncvertexindices; ibonevertexindex++)              {                 // vertex                 int nivertex = pvertexindices[ibonevertexindex];                  // weight                 float fweight = (float)pvertexweights[ibonevertexindex];             }         }     } 

how convert fbx transforms bone offset matrix?


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -