PDA

View Full Version : getting normals from 3ds models



Coluna
03-28-2003, 07:28 PM
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 :-)

mikael_aronsson
03-29-2003, 01:27 AM
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

03-30-2003, 02:18 AM
" 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.

naaina
03-31-2003, 03:08 AM
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.