.3ds loader and transformation matrix for lighting computation

Hi !
i am working on a .3ds loader and i have a problem :
i compute the normals and multiply it by the transformation matrix, and the problem it’s that sometimes it works well and sometimes i mustn’t make the multiplication to see the lighting work, it’s depending on meshes.
Can you tell how to know when make the multiplication, or if my analysis is wrong ?

Did you ensure your normals are normalized ?

i normalize just once at the end of the computations.

When I wrote a 3ds converter a few years ago I had the problem that on some models the normals were inverted while some worked as expected. This could be your problem, too, because the modelview transformation (or lack of it) could bring the inverted normals close enough to the correct ones so that you won’t notice the error…

I never really solved the problem, because it was not really an issue for me back then. I just used the program to convert the models to my own format, so I just made a commandline parameter to flip the normals when a model was wrong.

Did you tried lib3ds ?
The flipped normals is usually fixable with the Reset X-Form function from 3DS.

thanks guys !! the Reset X-Form function have saved me :smiley: