getting normals from 3ds models

Hi all;
I’m using 3ds models in my engine, but as 3ds doesn’t store vertex normal, I first get the face’s normal (cross product) and add this value to each verts normal, and after all faces, normalize the normal. But it doesn’t work very well, specially when environment reflection comes up. Does anybody knows other way to calculate it?
(sorry about my poor english :slight_smile:

Hi !

I guess you need to supply vertex normals, this is a bit more tricky to calculate, but the Graphics Gems code (don’t rember which one though) has code for doing this.

Mikael

" I first get the face’s normal (cross product) and add this value to each verts normal, and after all faces, normalize the normal. But it doesn’t work very well, specially when environment reflection comes up."

I had this same problem. Then if I used auto-normals, it was ok. All the normals were 1 and calculated correct I thought. Maybe we had a bug in our cross product calculations.

perhaps you had to transform the object in object coordinates before. the objects are stored in world coordinates in the 3ds file with the xform included. you have to transform it back, then calculate the face normals, and then transform it with the inverse xform. should work.