I want to render an animation from fbx file with OpenGL.
ViewScene is a good example, but it's too complicated for a novice to learn.
I am trying to understand how a fbx file orgnizes an animation.
If anyone can help, I will be appreciated.
Can anyone explain me this code ? thx
// Get the link initial global position and the link current global position.
lCluster->GetTransformLinkMatrix(lClusterGlobalInitPosition);
lClusterGlobalCurrentPosition = GetGlobalPosition(lCluster->GetLink(), pTime, pPose);
// Compute the initial position of the link relative to the reference.
lClusterRelativeInitPosition = lClusterGlobalInitPosition.Inverse() * lReferenceGlobalInitPosition;
// Compute the current position of the link relative to the reference.
lClusterRelativeCurrentPositionInverse = lReferenceGlobalCurrentPosition.Inverse() * lClusterGlobalCurrentPosition;
// Compute the shift of the link relative to the reference.
lVertexTransformMatrix = lClusterRelativeCurrentPositionInverse * lClusterRelativeInitPosition;
Honestly, I don't know of a better way to learn about FBX animation than look at the ImportScene and ViewScene demos.
Yes, they're complicated and long, but that's what animation is - a hard process. There's no easier way to learn it than learn a ton of code right out of the gate.
The piece of code you are asking about is applying keyframe data to the mesh - it takes the static mesh, calculates the difference between where the static mesh is and where the data in the keyframe is, and determines where it's actually supposed to be in the animation.
To actually create an animated application in OpenGL you are going to at least need to understand the ViewScene program. It's about as simple as it gets.
Yes, I'am now able to get the main idea of ViewScan.
But I still hardly know how all these matrixs work in the piece of code:
KFbxXMatrix lReferenceGlobalInitPosition;
KFbxXMatrix lReferenceGlobalCurrentPosition;
KFbxXMatrix lClusterGlobalInitPosition;
KFbxXMatrix lClusterGlobalCurrentPosition;
KFbxXMatrix lReferenceGeometry;
KFbxXMatrix lClusterGeometry;
KFbxXMatrix lClusterRelativeInitPosition;
KFbxXMatrix lClusterRelativeCurrentPositionInverse;
KFbxXMatrix lVertexTransformMatrix;
Can you show me the applying process more detailed and directly? Deely appreciated.
Can't find what you're looking for? Ask the community or share your knowledge.