Changeset 91 for Swollen/swollen/main.cpp
- Timestamp:
- Jun 2, 2005, 12:17:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/swollen/main.cpp
r88 r91 12 12 #include <osg/PositionAttitudeTransform> 13 13 #include <osg/StateAttribute> 14 #include <osgProducer/Viewer> 14 15 15 16 #include <project.h> 16 17 #include <SWWReader.h> 17 18 #include <bedslope.h> 18 #include <customviewer.h>19 19 #include <hud.h> 20 20 #include <keyboardeventhandler.h> … … 50 50 51 51 // construct the viewer. 52 CustomViewer viewer(arguments);52 osgProducer::Viewer viewer(arguments); 53 53 54 54 // set up with sensible default event handlers 55 55 viewer.setUpViewer( osgProducer::Viewer::STANDARD_SETTINGS ); 56 56 viewer.setClearColor( osg::Vec4(DEF_BACKGROUND_COLOUR) ); 57 viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200,300,800,600);57 //viewer.getCamera(0)->getRenderSurface()->setWindowRectangle(200,300,800,600); 58 58 viewer.getCullSettings().setComputeNearFarMode( osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES ); 59 59 … … 109 109 110 110 111 112 111 // root node 113 112 osg::Group* rootnode = new osg::Group; … … 176 175 177 176 // initial camera position 178 CustomTerrainManipulator* terrainmanipulator = viewer.getTerrainManipulator();179 terrainmanipulator->setNode( model );180 terrainmanipulator->setAutoComputeHomePosition( false );181 terrainmanipulator->setHomePosition(182 osg::Vec3d(0,-3,0), // camera location183 osg::Vec3d(0,0,0), // camera target184 osg::Vec3d(0,0,1) ); // camera up vector185 terrainmanipulator->moveToHome();186 terrainmanipulator->enable();177 //CustomTerrainManipulator* terrainmanipulator = viewer.getTerrainManipulator(); 178 //terrainmanipulator->setNode( model ); 179 //terrainmanipulator->setAutoComputeHomePosition( false ); 180 //terrainmanipulator->setHomePosition( 181 // osg::Vec3d(0,-3,0), // camera location 182 // osg::Vec3d(0,0,0), // camera target 183 // osg::Vec3d(0,0,1) ); // camera up vector 184 //terrainmanipulator->moveToHome(); 185 //terrainmanipulator->enable(); 187 186 188 187 … … 227 226 water->toggleWireframe(); 228 227 229 228 // click-mouse movement can change either camera view or scene light position 230 229 if( event_handler->toggleManipulatorMode() ) 231 232 230 { 231 } 233 232 234 233 235 // update the scene by traversing with the update visitor234 // update the scene by traversing with the update visitor 236 235 viewer.update(); 237 236 238 237 // fire off the cull and draw traversals of the scene. 239 238 viewer.frame(); 240 //pcam1->frame(false);241 //pcam2->frame();242 243 239 } 244 240
Note: See TracChangeset
for help on using the changeset viewer.