From 3c0966279c5bb27bd0cf9f3d850feb03ece783e4 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 29 May 2011 18:40:19 +0200 Subject: [PATCH] fixed #260: Scale animation also scales color Added missing normalization. Thanks to Lauri for analysing this. --- simgear/scene/model/SGScaleTransform.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simgear/scene/model/SGScaleTransform.cxx b/simgear/scene/model/SGScaleTransform.cxx index ab9d6215..7b485590 100644 --- a/simgear/scene/model/SGScaleTransform.cxx +++ b/simgear/scene/model/SGScaleTransform.cxx @@ -35,6 +35,11 @@ SGScaleTransform::SGScaleTransform() : _boundScale(1) { setReferenceFrame(RELATIVE_RF); + // see osg::Transform doc: If the transformation matrix scales the subgraph + // then the normals of the underlying geometry will need to be renormalized + // to be unit vectors once more. + osg::StateSet* stateset = getOrCreateStateSet(); + stateset->setMode(GL_NORMALIZE, osg::StateAttribute::ON); } SGScaleTransform::SGScaleTransform(const SGScaleTransform& scale, -- 2.39.5