I have an orientation issue with a .3ds model. It seems this is a known bug...
I have uploaded a file containing this model. It has been exported by 3D Studio Max 9.0.
It seems the initial orientation of the node (for instance BOTTOMRUDDER in my sample) has an issue.
Before exporting my models, this BOTTOMRUDDER object has an orientation.
When I import this new .3ds file into Max again, it doesn't have any orientation anymore, but looks fine.
When imported through assimp, the mTransformation matrix is set to identity, however, the model looks rotated.
Hmmm, I had a look at the source code and feel confused.
I am not a 3ds format expert, however, I don't see where you use the transformation chunk. It seems you save it into the mMat member when you find a CHUNK_TRMATRIX chunk.
However, this matrix is not used anymore (only to apply pivot). Also the mTransformation is always set to identity... Also, I don't see where you use the parent transformation as well...
Is that normal?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in 3dsloader.cpp one multiply vertex positions and mesh pivot Y component by -1.0f. However, no change is applied to the transformation read from the .3ds file.
Another thing, if you look at lib3ds_file.c, in the file_bounding_box_of_nodes_impl() function, you can see that they mix both the mesh matrix and the node instance matrix.
However, I still can't figure out what is wrong :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well, I wrote the 3DS loader. In fact I spent many, many hours with the issues you're describing. I found at out that some 3ds models I found on the web aren't correct, but I was also unable to find out which program wrote them. 3DS Max at least writes valid files so there must be something wrong with the loader :-)
The 3ds code is really dirty at the moment. I think the transformation matrix is read but never used.
>> Another thing, if you look at lib3ds_file.c, in the file_bounding_box_of_nodes_impl() function, you can see that they mix both the mesh matrix and the node instance matrix.
Thanks for posting! I'll fix that as soon as possible.
--- Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cool, great new ! I am going to test it as soon as possible ;)
Thanks a lot for your great work !
Once this library has reached an acceptable level of quality you should really advertise on it actively, i am sure lots of people would be interested in it use. Also, the more people use it the more chances there will be that someone will be motivated to maintain it in the future ;)
Good luck, I am one of these users already ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have an orientation issue with a .3ds model. It seems this is a known bug...
I have uploaded a file containing this model. It has been exported by 3D Studio Max 9.0.
It seems the initial orientation of the node (for instance BOTTOMRUDDER in my sample) has an issue.
Before exporting my models, this BOTTOMRUDDER object has an orientation.
When I import this new .3ds file into Max again, it doesn't have any orientation anymore, but looks fine.
When imported through assimp, the mTransformation matrix is set to identity, however, the model looks rotated.
Not sure this helps.
You can get my model on http://g.jaegy.free.fr/_divers/FA18.rar
I would be glad to help you to resolve this issue.
Cheers,
Greg
Hmmm, I had a look at the source code and feel confused.
I am not a 3ds format expert, however, I don't see where you use the transformation chunk. It seems you save it into the mMat member when you find a CHUNK_TRMATRIX chunk.
However, this matrix is not used anymore (only to apply pivot). Also the mTransformation is always set to identity... Also, I don't see where you use the parent transformation as well...
Is that normal?
Just another remark:
in 3dsloader.cpp one multiply vertex positions and mesh pivot Y component by -1.0f. However, no change is applied to the transformation read from the .3ds file.
Another thing, if you look at lib3ds_file.c, in the file_bounding_box_of_nodes_impl() function, you can see that they mix both the mesh matrix and the node instance matrix.
However, I still can't figure out what is wrong :(
Hi,
well, I wrote the 3DS loader. In fact I spent many, many hours with the issues you're describing. I found at out that some 3ds models I found on the web aren't correct, but I was also unable to find out which program wrote them. 3DS Max at least writes valid files so there must be something wrong with the loader :-)
The 3ds code is really dirty at the moment. I think the transformation matrix is read but never used.
>> Another thing, if you look at lib3ds_file.c, in the file_bounding_box_of_nodes_impl() function, you can see that they mix both the mesh matrix and the node instance matrix.
Thanks for posting! I'll fix that as soon as possible.
--- Alex
Hi,
3ds transformation problems are solved, you model loads correctly now!
Thanks for reporting that, this is a major improvement to the 3DS Loader.
Cheers,
Alex
Cool, great new ! I am going to test it as soon as possible ;)
Thanks a lot for your great work !
Once this library has reached an acceptable level of quality you should really advertise on it actively, i am sure lots of people would be interested in it use. Also, the more people use it the more chances there will be that someone will be motivated to maintain it in the future ;)
Good luck, I am one of these users already ;)