Changeset 11 for Swollen/swollen/main.cpp
- Timestamp:
- Nov 1, 2004, 10:53:50 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/swollen/main.cpp
r6 r11 113 113 model->addChild( water->get() ); 114 114 115 115 116 // center model in x and y 116 117 osg::BoundingBox bbox = bedslope->getBound(); … … 118 119 model->setScale( osg::Vec3(scale,scale,scale) ); 119 120 model->setPosition( -bbox.center()*scale ); 121 120 122 121 123 // sky … … 153 155 viewer.getTrackball()->moveToHome(); 154 156 155 // for lighting156 //#include <osgGA/TrackballManipulator>157 //osgGA::TrackballManipulator* trackball = new osgGA::TrackballManipulator;158 //trackball->setAutoComputeHomePosition( false );159 // trackball->setNode( spotlight->get() );160 //trackball->setByMatrix( spotlight->getMatrix() );161 //viewer.getEventHandlerList().push_front( trackball );162 163 164 // set up the animation path165 #include <osg/AnimationPath>166 osg::AnimationPath* animationPath = new osg::AnimationPath;167 animationPath->insert(0.0,osg::AnimationPath::ControlPoint( osg::Vec3(0,0,2) ));168 animationPath->insert(2.0,osg::AnimationPath::ControlPoint( osg::Vec3(2,0,0) ));169 animationPath->insert(4.0,osg::AnimationPath::ControlPoint( osg::Vec3(0,0,2) ));170 animationPath->insert(6.0,osg::AnimationPath::ControlPoint( osg::Vec3(-2,0,0) ));171 animationPath->insert(8.0,osg::AnimationPath::ControlPoint( osg::Vec3(0,0,2) ));172 animationPath->setLoopMode(osg::AnimationPath::LOOP);173 174 157 175 158 while( !viewer.done() ) … … 190 173 } 191 174 192 // std::cout << viewer.getTrackball()->getMatrix() << std::endl;193 //spotlight->setMatrix( trackball->getInverseMatrix() );194 195 // light animation196 //osg::AnimationPath::ControlPoint cp;197 //bool rc = animationPath->getInterpolatedControlPoint( time, cp );198 //spotlight->setPosition( cp._position );199 200 175 // watersurface 201 176 if( event_handler->toggleWireframe() )
Note: See TracChangeset
for help on using the changeset viewer.