From: Orhun B. <orh...@gm...> - 2008-08-26 20:35:56
|
I'll ask a question from a completely different view. Note that I am not excatly proposing this, I am just mentioning it so that we can discuss... Do we need to check for a tolerance? In debug, we can do whatever we want (i.e. assert etc) but for release I don't believe we have to check anything. Just continue the calculations as if nothing happened. What happens when you load a singular matrix to OpenGL with glLoadMatrix(or glMultMatrix)? Spec mentions singular matrices several times and it basically says the results are undefined. >From OpenGL Spec 3.0 page 58 If the GL implementation determines that the modelview matrix is uninvertible, then the entries in the inverted matrix are arbitrary. In any case, neither normal transformation nor use of the transformed normal may lead to GL interruption or termination. Why should glmMatInverse be any different? Such low level functions should not have such checks (or such behaviours defined). Higher level code should check whether the matrices they generate are well conditioned. <semiserious> We can always provide "safe" versions, which will have more defined behaviours. glmMatInverse4f_s anyone? </semiserious> -- Orhun Birsoy |