Help on a FBX converter
Posted: Tue Apr 15, 2014 10:08 am
I'm developing an fbx converter, to get the animation from the grimrock format to the fbx one.
Right now I'm stuck creating the skeleton, I'm not getting it right.
I asked John but I think is busy, so I don't wanna bug him that much.
Anyway let's back to the topic, here's what I wrote to John, maybe someone else can help me.(Bear in mind I'm not a master regarding c++ )
Should I use the node matrix or the bone inversematrix from the grimrock object model?
I quite don't understand when I'm creating the bone structures how to calculate traslations.
I don't know that much 3d math so what does this mean?
// A Mat4x3 is a transformation matrix split into 3x3 rotation and 3D rotation parts
struct Mat4x3
{
Vec3 baseX;
Vec3 baseY;
Vec3 baseZ;
Vec3 translation;
}
I thought regarding the creation of bones, matrix should be a transformation matrix not a rotation matrix.
So I'm kinda confused.
Anyway I should calculate this way? (o = origin)
x' = x*x1 + y*y1 + z*z1 + o1;
y' = x*x2 + y*y2 + z*z2 + o2;
z' = x*x3 + y*y3 + z*z3 + o3;
I'm using right now the matrix of the node, not the one of the bone!
Should I calculate first the node translation and then apply the inverse for the bone?
I think an example code is way better than a thousand words
here's a zip to my project, it's made with vs2013, I start exporting from an xml created serializing the object of that animation editor made by that other guy named "Xanathar" on the forum.
https://dl.dropboxusercontent.com/u/217 ... verter.zip
Inside you'll find the animation for the ogre attack named "mesh.xml"
Right now I'm stuck creating the skeleton, I'm not getting it right.
I asked John but I think is busy, so I don't wanna bug him that much.
Anyway let's back to the topic, here's what I wrote to John, maybe someone else can help me.(Bear in mind I'm not a master regarding c++ )
Should I use the node matrix or the bone inversematrix from the grimrock object model?
I quite don't understand when I'm creating the bone structures how to calculate traslations.
I don't know that much 3d math so what does this mean?
// A Mat4x3 is a transformation matrix split into 3x3 rotation and 3D rotation parts
struct Mat4x3
{
Vec3 baseX;
Vec3 baseY;
Vec3 baseZ;
Vec3 translation;
}
I thought regarding the creation of bones, matrix should be a transformation matrix not a rotation matrix.
So I'm kinda confused.
Anyway I should calculate this way? (o = origin)
x' = x*x1 + y*y1 + z*z1 + o1;
y' = x*x2 + y*y2 + z*z2 + o2;
z' = x*x3 + y*y3 + z*z3 + o3;
I'm using right now the matrix of the node, not the one of the bone!
Should I calculate first the node translation and then apply the inverse for the bone?
I think an example code is way better than a thousand words
here's a zip to my project, it's made with vs2013, I start exporting from an xml created serializing the object of that animation editor made by that other guy named "Xanathar" on the forum.
https://dl.dropboxusercontent.com/u/217 ... verter.zip
Inside you'll find the animation for the ogre attack named "mesh.xml"