From 45eefec3f0177e980727b50070c81de99932f6a0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 14 Oct 2001 14:23:47 +0000 Subject: [PATCH] Fixed TransformFunctor code so that it now uses the inverse of the transformation matrix to transform the normal. --- src/Demos/osgconv/orientationconverter.cpp | 22 +++++++++------------- src/Demos/sgv/sgv.cpp | 13 ++++++++----- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/Demos/osgconv/orientationconverter.cpp b/src/Demos/osgconv/orientationconverter.cpp index fcbb9e824..b3d3b2b8f 100644 --- a/src/Demos/osgconv/orientationconverter.cpp +++ b/src/Demos/osgconv/orientationconverter.cpp @@ -9,10 +9,14 @@ class TransformFunctor : public osg::Drawable::AttributeFunctor public: osg::Matrix _m; + osg::Matrix _im; TransformFunctor(const osg::Matrix& m): - AttributeFunctor(osg::Drawable::COORDS|osg::Drawable::NORMALS), - _m(m) {} + AttributeFunctor(osg::Drawable::COORDS|osg::Drawable::NORMALS) + { + _m = m; + _im.invert(_m); + } virtual ~TransformFunctor() {} @@ -30,16 +34,8 @@ class TransformFunctor : public osg::Drawable::AttributeFunctor { for (osg::Vec3* itr=begin;itr