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"
Help on a FBX converter
Help on a FBX converter
Last edited by kaomao on Thu Aug 07, 2014 12:34 pm, edited 1 time in total.
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Help on a FBX converter
I don't know nothing about coding but I can see the value in this tool you are trying to create.
If it helps you , then Wallasaurus created 3d max scripts that import the Grimrock model format into 3d max (fbx)
Maybe if you look through the scripts it will give you some insight into how to get the rig into fbx format.
The scripts can be found here
https://dl.dropbox.com/u/5440025/GRIMRO ... NCTIONS.ms
Skuggasveinn.
If it helps you , then Wallasaurus created 3d max scripts that import the Grimrock model format into 3d max (fbx)
Maybe if you look through the scripts it will give you some insight into how to get the rig into fbx format.
The scripts can be found here
https://dl.dropbox.com/u/5440025/GRIMRO ... NCTIONS.ms
Skuggasveinn.
Re: Help on a FBX converter
Hmm, thats interesting, your's link leads to wallassaurus script I have never seen, it's different than my own modification of his original code (there was some crashing bug) - so it's maybe newer and better version I have. Original size is 76kB, my is 78kB, but this one is 94kB - so thanks for sharing, I will check where the difference is

I'm the Gate I'm the Key.
Dawn of Lore
Dawn of Lore
Re: Help on a FBX converter
Oh god thank you so muchSkuggasveinn wrote:I don't know nothing about coding but I can see the value in this tool you are trying to create.
If it helps you , then Wallasaurus created 3d max scripts that import the Grimrock model format into 3d max (fbx)
Maybe if you look through the scripts it will give you some insight into how to get the rig into fbx format.
The scripts can be found here
https://dl.dropbox.com/u/5440025/GRIMRO ... NCTIONS.ms
Skuggasveinn.

Yes it will help a lot for sure!
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Help on a FBX converter
Sorry I've not had a chance to look at your code yet. I've been fighting some frustrating quirks of Qt in the last week since I've been back from holiday and it's not left me in the mood to look at much other C++ code in my spare time - especially as the FBX SDK is such a behemoth and always take a lot of time and effort to get into!
I'll try to take a look soon, but failing that - I'll try to post a clear explanation of the whole bones/invRestMatrix/skinning system in the hopes that will help.
One thing I have noticed - you have quite a few 'new' calls but no 'delete' calls in any destructors or anything. That means that all of your objects are being created in memory but never destroyed - causing a memory leak. You either need to have a delete call somewhere for every 'new' call, or even better, use std::unique_ptr objects (#include <memory>) to track ownership of the pointers and automatically delete the objects for you when the parent object is deleted.
I'll try to take a look soon, but failing that - I'll try to post a clear explanation of the whole bones/invRestMatrix/skinning system in the hopes that will help.
One thing I have noticed - you have quite a few 'new' calls but no 'delete' calls in any destructors or anything. That means that all of your objects are being created in memory but never destroyed - causing a memory leak. You either need to have a delete call somewhere for every 'new' call, or even better, use std::unique_ptr objects (#include <memory>) to track ownership of the pointers and automatically delete the objects for you when the parent object is deleted.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Help on a FBX converter
JohnWordsworth wrote:Sorry I've not had a chance to look at your code yet. I've been fighting some frustrating quirks of Qt in the last week since I've been back from holiday and it's not left me in the mood to look at much other C++ code in my spare time - especially as the FBX SDK is such a behemoth and always take a lot of time and effort to get into!
I'll try to take a look soon, but failing that - I'll try to post a clear explanation of the whole bones/invRestMatrix/skinning system in the hopes that will help.
One thing I have noticed - you have quite a few 'new' calls but no 'delete' calls in any destructors or anything. That means that all of your objects are being created in memory but never destroyed - causing a memory leak. You either need to have a delete call somewhere for every 'new' call, or even better, use std::unique_ptr objects (#include <memory>) to track ownership of the pointers and automatically delete the objects for you when the parent object is deleted.
Thank you John!
Yes I suck at c++ and I stated in other messages I sent you I didn't do any "garbage collection thingy" myself, it's just a test to see if I can get this thing to work, then I'll clean up the code or I'll use smart pointers (I used vectors which are smart pointers if I'm not wrong).
Anyway I'm a c# guy, so as all those c# guys I'm lazy ahahah