From: Rouben R. <ros...@um...> - 2003-02-08 20:03:40
|
Brian, re your message regarding non-uniform scaling, you wrote: > GL_NORMALIZE computes the magnitude of the normal vector, > then divides the components of the normal by the magnitude. > The result is a unit-lengh normal vector, regardless of scale > factors. However, the _direction_ of the normal may not be > correct for non-uniform scales. Mesa/OpenGL can't do anything > about that. So we agree that the _direction_ of the recomputed normal vector is incorrect in general. Well, if that is not a bug, then what is it? What is the use of computing a vector which does not point in the right direction? I don't agree that "Mesa/OpenGL can't do anything about that". Consider a point P on a surface S and let N be the normal to S at P. Suppose that the tangent plane at P looks like this: ax + by + cz = d, therefore the normal vector is N = (a, b, c). OpenGL/Mesa receives the normal vector N from the user. Now suppose that the space is scaled by factors u, v, w in the x, y, z directions. Then the tangent plane transforms to: aux + bvy + cwz = d, which says that the new normal vector is N' = (au, bv, cw) which is easily computable. Compute N' then reduce it to unit length. > I don't see an open bug related to GL_NORMALIZE and I'm not > aware of any known issues with it. My recollection is that you looked into the issue and concluded that Mesa was doing the right thing. The bug report then was marked as closed/resolved. -- Rouben Rostamian <ros...@um...> |