GLTF Wie sollen die Animationsmatrizen berechnet werden?C++

Programme in C++. Entwicklerforum
Anonymous
 GLTF Wie sollen die Animationsmatrizen berechnet werden?

Post by Anonymous »

Ich versuche, Animationen für komplexe GLTF-Modelle zu bearbeiten.

Code: Select all

std::vector GetGlobalJointMatrices(
const std::vector& local_matrices,
const std::vector& animation_matrices,
const std::map& skeleton,
const int start_joint)
{
std::vector skeleton_matrices(skeleton.size());
skeleton_matrices[0] = Eigen::Matrix4f::Identity();

for(auto [child, parent]: skeleton)
{
skeleton_matrices[child - start_joint] = skeleton_matrices[parent - start_joint] *
local_matrices[child - start_joint] * animation_matrices[child - start_joint];
}

return skeleton_matrices;
}
< /code>
Hier beziehtanimation_matrices
sind nur die Animationen, die Knoten in der Haut abzielen. Ich habe überprüft, ob die Animationen korrekt geladen werden und in der richtigen Reihenfolge.

Code: Select all

skeleton_matrices[child - start_joint] = skeleton_matrices[parent - start_joint] *
local_matrices[child - start_joint];

Wenn ich versuche, die Animationsmatrizen anzuwenden, erhalten ich:

Code: Select all

animation targetting node:10
rotation: 0.0245355 -0.319997    0.9446 0.0687827
translation: -0.00234646  -0.0661734   0.0278567
scales: 1 1 1
node 6:
animation targetting node:6
rotation: -0.0341418  -0.319178   0.946171 -0.0414678
translation: -0.00145852  -0.0661988   0.0278567
Ich habe gegangen und verifiziert, dass diese Werte manuell korrekt sind.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post