Changeset 315 for experimental/distortionNG/main.cpp
- Timestamp:
- Sep 4, 2011, 9:13:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/main.cpp
r313 r315 41 41 // construct the viewer. 42 42 extViewer viewer(arguments); 43 viewer.setUpViewForManualDistortion(); 44 43 45 44 46 // set up the camera manipulators. … … 104 106 return 1; 105 107 } 108 else 109 viewer.setSceneData( rootnode ); 106 110 } 107 111 108 osg::ref_ptr<osg::Geode> geode = new osg::Geode;109 geode->addDrawable( extViewer::createMesh(16, 9) );110 geode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );111 geode->getOrCreateStateSet()->setAttributeAndModes( new osg::PolygonOffset(1.0f, 1.0f) );112 //osg::ref_ptr<osg::Geode> geode = new osg::Geode; 113 //geode->addDrawable( extViewer::createMesh(16, 9) ); 114 //geode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); 115 //geode->getOrCreateStateSet()->setAttributeAndModes( new osg::PolygonOffset(1.0f, 1.0f) ); 112 116 113 osg::ref_ptr<distortionHandler> selector = new distortionHandler( viewer.getCamera() );117 //osg::ref_ptr<distortionHandler> selector = new distortionHandler( viewer.getCamera() ); 114 118 115 osg::ref_ptr<osg::Group> root = new osg::Group;116 root->addChild( geode.get() );117 root->addChild( selector->createVertexHighlighter() );119 //osg::ref_ptr<osg::Group> root = new osg::Group; 120 //root->addChild( geode.get() ); 121 //root->addChild( selector->createVertexHighlighter() ); 118 122 119 viewer.addEventHandler( selector.get() );120 viewer.setSceneData( root.get() );123 //viewer.addEventHandler( selector.get() ); 124 //viewer.setSceneData( root.get() ); 121 125 122 // Avoid that the highlighter is culled away123 osg::CullSettings::CullingMode mode = viewer.getCamera()->getCullingMode();124 viewer.getCamera()->setCullingMode( mode & (~osg::CullSettings::SMALL_FEATURE_CULLING) );126 //// Avoid that the highlighter is culled away 127 //osg::CullSettings::CullingMode mode = viewer.getCamera()->getCullingMode(); 128 //viewer.getCamera()->setCullingMode( mode & (~osg::CullSettings::SMALL_FEATURE_CULLING) ); 125 129 126 130 // run the viewers main loop
Note: See TracChangeset
for help on using the changeset viewer.