Show
Ignore:
Timestamp:
05/28/07 17:17:27 (7 years ago)
Author:
robert
Message:

Improved the accuracy of the overlaynode settings

Files:
1 modified

Legend:

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

    r6776 r6777  
    182182    osg::Group* root = new osg::Group; 
    183183 
    184     float baseHeight = center.z()-radius*0.6; 
    185     osg::Node* baseModel = createBase(center-osg::Vec3(0.0f,0.0f,radius*0.5),radius); 
     184    float baseHeight = center.z()-radius*0.5; 
     185    osg::Node* baseModel = createBase(osg::Vec3(center.x(), center.y(), baseHeight),radius); 
    186186    osg::Node* movingModel = createMovingModel(center,radius*0.8f); 
    187187 
     
    191191        overlayNode->setContinuousUpdate(true); 
    192192        overlayNode->setOverlaySubgraph(movingModel); 
    193         overlayNode->setOverlayBaseHeight(baseHeight); 
     193        overlayNode->setOverlayBaseHeight(baseHeight-0.01); 
    194194        overlayNode->addChild(baseModel); 
    195195        root->addChild(overlayNode); 
     
    244244    viewer.setCameraManipulator(new osgGA::TrackballManipulator()); 
    245245 
    246 #if 0 
     246#if 1 
    247247 
    248248    // use of custom simulation time. 
     
    250250    viewer.realize(); 
    251251     
    252     double simulationTime = 100.0; 
     252    double simulationTime = 0.0; 
    253253     
    254254    while (!viewer.done()) 
    255255    { 
    256256        viewer.frame(simulationTime); 
    257         simulationTime -= 0.01; 
     257        simulationTime += 0.001; 
    258258    } 
    259259