Thursday, June 30, 2022
HomeGame Developmentmatrix - Apply a mocap to a number of completely different fashions?...

matrix – Apply a mocap to a number of completely different fashions? -> modify gltf immediately?


I’m presently fighting an animation I made that I would really like utilized to a number of fashions, all completely different, however from the identical vertices.
I have already got a customized gltf importer prepared however I would like to shine my exporter. Therefore the query.

The primary mannequin has been exported to gltf and is okay.

My query is: is there a easy, programmatic, solution to edit this GLTF file to put the bones of the subsequent mannequin at completely different areas (that I do know) to nonetheless profit from an accurate animation or not?
That might be simpler/sooner than handbook changes.

I performed with vertices place contained in the GLTF, however the result’s a distorted mannequin.
Tried to change the animation matrices immediately as properly: identical ugly consequence (that is simply an excerpt displaying that I push all ancestors after which begin from the foundation, all the way down to my bone of selection):

whereas ( 1 ){
    
        chain.push_back( node_idx );

        if ( armature[node_idx].dad or mum == CONDITION_STOP ){

                break;

        }

        node_idx = armature[node_idx].dad or mum;

}

for ( auto curr = chain.rbegin(), curr_end = chain.rend(); curr != curr_end; ++curr ){

        u32 node_idx = *curr;
        // skipped: choose the best animation indices, then:
        mat4 mmat_current = compose( translation, rotation, scale);

        mat = multiply( mat, mmat_current );
        // hold going with mat

}

Perhaps there’s something to attempt with the inversebindmatrix[i] however I actually need a pointer right here.
So, what are my choices please? What did I get improper?

Thanks,

Edit: image of the issue. The skeleton is identical measurement, regardless of the mannequin being completely different:
enter image description here

How on earth can I drag the bone to their 3D place (I do know the ultimate 3D place within the world world every bone ought to have) ?

I attempted to solely play with translation matrices: fail.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments