From Roger James, added GL_NORMALIZE mode to scaled models

This commit is contained in:
Robert Osfield 2007-07-03 10:00:41 +00:00
parent e7d7c1dcc2
commit dd628a9829

View File

@ -58,6 +58,12 @@ Node* OrientationConverter::convert( Node *node )
transform->setDataVariance(osg::Object::STATIC); transform->setDataVariance(osg::Object::STATIC);
transform->setMatrix( C * R * S * T ); transform->setMatrix( C * R * S * T );
if (!S.isIdentity())
{
// Add a normalize state. This will be removed if the FlattenStaticTransformsVisitor works
transform->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
}
root->addChild(transform); root->addChild(transform);
transform->addChild(node); transform->addChild(node);