|
From: Dair G. <da...@re...> - 2004-08-03 22:22:23
|
Roger Holmes wrote: >Am I being simple in thinking that multiplying by localToWorld will do >the trick? Probably, the rotational component is fine but will non >uniform scaling in X,Y & Z and shearing mess things up? Yes, an affine transformation such as a shear will mean the normals are no longer correct if they're just pushed through the local to world: <http://www.worldserver.com/turk/computergraphics/NormalTransformations. pdf> >So I guess that's it, but it is a heavy bit of calculation. Should we >be doing it when we get a 'hit' or every time we change localToWorld? >I guess there are typically not many hits, and it would be easier to >put the code in the existing routine. Or is this matrix calculated >somewhere already? We record the local to world along with the pick, so we could defer this transform until we actually find the app wants the normal vector. I.e., record the local normal and the current L->W transform when collecting the hit information, and defer the expensive work (like normalisation) until we know the app actually wants that information back. >Our tester has given my changes to E3Triangle_InterpolateHit a few >hours testing in Microspot Modeller and it seems to be pretty solid >now. We will be making the golden master of Modeller this week. > >Any objections to me checking in the changes to Quesa? This solution would be a step forward for the short term anyway, as it'd mean we would return the correct result if you're just doing a rotation/translation/uniform scale as your transform. So I'd go with that for now (unless you want to do the general fix too), but could you log a bug indicating that this isn't going to be 100% correct? -dair ___________________________________________________ mailto:dair+refnum.com http://www.refnum.com/ |