Show
Ignore:
Timestamp:
10/13/04 15:39:27 (10 years ago)
Author:
robert
Message:

Increased the size of the inserted model so that it can be seen more easily,

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgsimulation/osgsimulation.cpp

    r3470 r3490  
    9191        _latitude(0.0), 
    9292        _longitude(0.0), 
    93         _height(10000.0) 
     93        _height(100000.0) 
    9494         {} 
    9595 
    9696    void updateParameters() 
    9797    { 
    98         _latitude -= ((2.0*osg::PI)/360.0)/100.0; 
     98        _latitude -= ((2.0*osg::PI)/360.0)/20.0; 
    9999    } 
    100100 
     
    193193 
    194194    viewer.getCullSettings().setComputeNearFarMode(osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES); 
    195     viewer.getCullSettings().setNearFarRatio(0.0001f); 
     195    viewer.getCullSettings().setNearFarRatio(0.00001f); 
    196196 
    197197    // get details on keyboard and mouse bindings used by the viewer. 
     
    228228        if (cessna) 
    229229        { 
     230            double s = 30000.0 / cessna->getBound().radius(); 
     231         
     232            osg::MatrixTransform* scaler = new osg::MatrixTransform; 
     233            scaler->addChild(cessna); 
     234            scaler->setMatrix(osg::Matrixd::scale(s,s,s)); 
     235            scaler->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL,osg::StateAttribute::ON);         
     236         
    230237            osg::MatrixTransform* mt = new osg::MatrixTransform; 
    231             mt->addChild(cessna); 
     238            mt->addChild(scaler); 
    232239            mt->setUpdateCallback(new ModelPositionCallback); 
    233240 
     
    235242 
    236243            osgGA::NodeTrackerManipulator* tm = new osgGA::NodeTrackerManipulator; 
    237             tm->setTrackNode(cessna); 
     244            tm->setTrackNode(scaler); 
    238245 
    239246            unsigned int num = viewer.addCameraManipulator(tm);