Changeset 10051

Show
Ignore:
Timestamp:
04/16/09 09:13:41 (5 years ago)
Author:
robert
Message:

svn-commit.2.tmp

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/13_paged_databases/13b_simulation/13b_simulation.cpp

    r10048 r10051  
    3333    mt->addChild(plane); 
    3434 
     35    mt->setNodeMask(~0x1); 
     36 
    3537    osg::ref_ptr<osg::Group> root = new osg::Group; 
    3638    root->addChild(terrain); 
     
    4850 
    4951    osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 
    50     traits->x = 100; 
    51     traits->y = 100; 
    52     traits->width = 1000; 
    53     traits->height = 800; 
    54     traits->windowDecoration = true; 
     52    traits->x = 400; 
     53    traits->y = 0; 
     54    traits->width = 1024; 
     55    traits->height = 768; 
     56    traits->windowDecoration = false; 
    5557    traits->doubleBuffer = true; 
    5658    traits->sharedContext = 0; 
     
    8183        view1->getCamera()->setViewport(new osg::Viewport(0,0, traits->width, traits->height)); 
    8284        view1->getCamera()->setGraphicsContext(gc.get()); 
    83  
     85        view1->getCamera()->setCullMask(0x1); 
    8486        osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 
    8587 
     
    113115        view2->getCamera()->setViewport(new osg::Viewport(traits->width*3/4,traits->height*3/4, traits->width/4, traits->height/4)); 
    114116        view2->getCamera()->setGraphicsContext(gc.get()); 
     117        view2->getCamera()->setNearFarRatio(0.00001); // 0.0005f 
    115118 
    116119        osg::ref_ptr<osgGA::NodeTrackerManipulator> ntm = new osgGA::NodeTrackerManipulator; 
     
    132135        viewer.advance(); 
    133136        viewer.eventTraversal(); 
     137 
     138        osg::Matrixd viewMatrix = view1->getCamera()->getViewMatrix(); 
     139        osg::Matrixd world = osg::Matrix::rotate(osg::inDegrees(180.0),0,1,0) * 
     140                             osg::Matrix::rotate(osg::inDegrees(90.0),1,0,0) * 
     141                             osg::Matrixd::inverse(viewMatrix); 
     142        mt->setMatrix(world); 
     143 
    134144        viewer.updateTraversal(); 
    135145 
    136         mt->setMatrix(osg::Matrixd::inverse(view1->getCamera()->getViewMatrix())); 
    137146 
    138147        viewer.renderingTraversals();