I didn't put this in the "SMOD" thread so we don't mix things.
I'm trying to load 3DC models (Mobs actually) into 3dStudio. So far I can read the 3D info (vertices, faces, etc) to form the model:
But for this to be useful, we also need the bones info. (So we later can save that back to a 3DC file).
And I fail to read that, this is what I get (all messed up bones):
In 3dstudio, to create a bone, we do
BoneSys.createBone <point3>startPos <point3>endPos <point3>zAxis
Using the info from castor4878 in this post [Only registered and activated users can see links. Click Here To Register...] I can read the bone data, into a transform matrix:
tfm = matrix3 [m11,m12,m13] [m21,m22,m23] [m31,m32,m33] [m41,m42,m43]
But this is a 4x3 matrix, while 3DC says 'a 4x4 matrix' (I think so :p)
Also to build a bone hierarchy we would need each bone ParentID, so all bones form a 'chain'.
So, anyone knows what info is stored in that '4 x 4' matrix or has a dump of the data? Or any more info about the BoneMatrix in 3DC files?
PS: This is the code used to import a 3DC from Data\Monster\3DC (use it on a small mob that has only 1 MODEL!)
You just run it and the mob will be created in 3dstudio.
Edit:
I've searched everywere and looks like none faund a way to extract bone info into a 'useable' skeleton. So, no way to make new mobs with new animations.
Now, with the code I posted above, you can also import armors into 3dstudio (withoout bones). Just import them piece by piece, they will take the correct position.
Same with complex mobs or bosses with multiple pieces, import them piece by piece, then group them in 3dstudio. You can apply the game textures to the models, and they will match.
At least is useful if you want to render them and make original pictures, to use in the Loading... screens.
Here's a test:
If you have any doubt, maxscript its a huge language, and has a online manual with all the commands.
I'm trying to load 3DC models (Mobs actually) into 3dStudio. So far I can read the 3D info (vertices, faces, etc) to form the model:
But for this to be useful, we also need the bones info. (So we later can save that back to a 3DC file).
And I fail to read that, this is what I get (all messed up bones):
In 3dstudio, to create a bone, we do
BoneSys.createBone <point3>startPos <point3>endPos <point3>zAxis
Using the info from castor4878 in this post [Only registered and activated users can see links. Click Here To Register...] I can read the bone data, into a transform matrix:
tfm = matrix3 [m11,m12,m13] [m21,m22,m23] [m31,m32,m33] [m41,m42,m43]
But this is a 4x3 matrix, while 3DC says 'a 4x4 matrix' (I think so :p)
Also to build a bone hierarchy we would need each bone ParentID, so all bones form a 'chain'.
So, anyone knows what info is stored in that '4 x 4' matrix or has a dump of the data? Or any more info about the BoneMatrix in 3DC files?
PS: This is the code used to import a 3DC from Data\Monster\3DC (use it on a small mob that has only 1 MODEL!)
You just run it and the mob will be created in 3dstudio.
Edit:
I've searched everywere and looks like none faund a way to extract bone info into a 'useable' skeleton. So, no way to make new mobs with new animations.
Now, with the code I posted above, you can also import armors into 3dstudio (withoout bones). Just import them piece by piece, they will take the correct position.
Same with complex mobs or bosses with multiple pieces, import them piece by piece, then group them in 3dstudio. You can apply the game textures to the models, and they will match.
At least is useful if you want to render them and make original pictures, to use in the Loading... screens.
Here's a test:
If you have any doubt, maxscript its a huge language, and has a online manual with all the commands.