Thank you Robert,

I think I'm unclear on how to scale the subgraph.  

I tried adding a PositionAttitudeTransform object as a child of the
AutoTransform and scaling it.  I also tried adding the AutoTransform as
a child to a PositionAttitudeTransform that is scaled.  Neither seemed
to work.  Am I doing something wrong?  

My goal is to have my drawable object the same size no matter how much
you zoom in or out, but I need to control the initial size.  Is their a
better way of doing this?


Code Snippets:

PositionAttitudeTransform object as a child of the AutoTransform
------------------------------------------------------------------

      osg::Group* root = new osg::Group();
      osg::Geode* geode = new osg::Geode();

        //AutoTrans
        osg::AutoTransform* at  = new osg::AutoTransform;
        at->setAutoScaleToScreen(true);
      at->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);

        //Initial Scale
        osg::PositionAttitudeTransform* postrans = new
osg::PositionAttitudeTransform();
        osg::Vec3 modelScale;
        double value = 10000;
        modelScale.set(value,value,value); 
        postrans->setScale( modelScale ); 
        
        geode->addDrawable(new Symbol(getEntityTD()));
      postrans->addChild(geode);

        at->addChild(postrans); 
        
        root->addChild(at);
   
        return root;


AutoTransform as a child to a PositionAttitudeTransform
------------------------------------------------------------------

      osg::Group* root = new osg::Group();
      osg::Geode* geode = new osg::Geode();

        //AutoTrans
        osg::AutoTransform* at  = new osg::AutoTransform;
        at->setAutoScaleToScreen(true);
      at->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);      
        geode->addDrawable(new Symbol(getEntityTD()));
      at->addChild(geode);

        //Initial Scale
        osg::PositionAttitudeTransform* postrans = new
osg::PositionAttitudeTransform();
        osg::Vec3 modelScale;
        double value = 10000;
        modelScale.set(value,value,value); 
        postrans->setScale( modelScale ); 

        postrans->addChild(at);
        
        root->addChild(postrans);
   
        return root;


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Tuesday, July 24, 2007 1:16 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Possible Bug in osg::AutoTransform


Hi Nelson,

This isn't a bug, when you do scale to screen what it does it uses puts
the subgraph into screen space by adjusting the scale parameter to fit.
If you want to change the scale of the subgraph then it'll need to built
with screen space coords in mind.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to