I had forgotten that you were transforming normal vectors, and not vertices ! So you must not apply the translation to them, so the 3x3 matrix is what you need !
That’s fine : apply only the 3x3 matrix obtained from TM_ROW0,1,2 to the normal vectors. TM_ROW3 has nothing to do with normal vectors : it’s only for vertices.
>But there when i have test it with a cube, there are only 2 sides in light.
this is not necessarily a bug, that depends of where you place your light. have you tried other positions/directions for your light ?
What I do when loading an ASE file is invert the given Matrix and apply it to the vertices. Then I get them in local coords. When displaying, I use glLoadMatrix and issue the glNormal/glVertex with the values I get (i.e. for the normals, straight from the ASE and for the vertices, the ones obtained after the multiplication described above).
This basically explains that normals are transformed by the inverse transpose of the transformation that transforms vertices.
Hence, I am wondering whether you’d get the proper result if you multiplied the normals by the matrix given in the ASE file…
Regards,
Eric
P.S.: Morglum, I tried to find a link to these hints you mentioned. If I remember correctly, I sent them to you by e-mail after I flamed you for posting a question about “sscanf”. I found this topic and had quite a good laugh !
Also thanks for the interesting link. Interesting to see that the concept of a tangent plane to a surface is more appropriate to do lighting computations than the concept of a normal vector. I’m sure that CG is going to absorb more and more riemannian geometry.