|
From: Roger H. <rog...@mi...> - 2004-07-29 16:25:42
|
There is a bug in E3Triangle_InterpolateHit when it is asked to return a normal vector. It should return a normal in world coordinates, and if there are no normals in the attribute set of the surface, nor in the attribute sets of the vertices then all is well. When there are normals then it takes these (which are in local coordinates) and does some averaging of them and then returns them as if they were in world coordinates. I have fixed this in my version of Quesa by passing the view into E3Triangle_InterpolateHit and then calling Q3Vector3D_Transform where appropriate. I also have to include E3View.h in E3Utils.c so I can get the transform using E3View_State_GetLocalToWorld. Is this OK? Should I pass in the matrix instead? Should it return a flag to say if the normal is in world or local coordinates and then fix it in the calling code (2 places)? Should it pick it up in some other way? Also, when the normal is calculated from three vertex normals, it can result in a normal which is not normalised. Is there any good reason for this or can I normalise it? Roger. |