Changeset 10051
- Timestamp:
- 04/16/09 09:13:41 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/13_paged_databases/13b_simulation/13b_simulation.cpp
r10048 r10051 33 33 mt->addChild(plane); 34 34 35 mt->setNodeMask(~0x1); 36 35 37 osg::ref_ptr<osg::Group> root = new osg::Group; 36 38 root->addChild(terrain); … … 48 50 49 51 osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 50 traits->x = 100;51 traits->y = 100;52 traits->width = 10 00;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; 55 57 traits->doubleBuffer = true; 56 58 traits->sharedContext = 0; … … 81 83 view1->getCamera()->setViewport(new osg::Viewport(0,0, traits->width, traits->height)); 82 84 view1->getCamera()->setGraphicsContext(gc.get()); 83 85 view1->getCamera()->setCullMask(0x1); 84 86 osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 85 87 … … 113 115 view2->getCamera()->setViewport(new osg::Viewport(traits->width*3/4,traits->height*3/4, traits->width/4, traits->height/4)); 114 116 view2->getCamera()->setGraphicsContext(gc.get()); 117 view2->getCamera()->setNearFarRatio(0.00001); // 0.0005f 115 118 116 119 osg::ref_ptr<osgGA::NodeTrackerManipulator> ntm = new osgGA::NodeTrackerManipulator; … … 132 135 viewer.advance(); 133 136 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 134 144 viewer.updateTraversal(); 135 145 136 mt->setMatrix(osg::Matrixd::inverse(view1->getCamera()->getViewMatrix()));137 146 138 147 viewer.renderingTraversals();
