- Timestamp:
- 11/17/05 21:22:55 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgdepthpartition/osgdepthpartition.cpp
r4626 r4805 24 24 osg::Node* createScene() 25 25 { 26 // Create the Earth, in blue27 osg::ShapeDrawable *earth_sd = new osg::ShapeDrawable;28 osg::Sphere* earth_sphere = new osg::Sphere;29 earth_sphere->setRadius(r_earth);30 earth_sd->setShape(earth_sphere);31 earth_sd->setColor(osg::Vec4(0, 0, 1.0, 1.0));26 // Create the Earth, in blue 27 osg::ShapeDrawable *earth_sd = new osg::ShapeDrawable; 28 osg::Sphere* earth_sphere = new osg::Sphere; 29 earth_sphere->setRadius(r_earth); 30 earth_sd->setShape(earth_sphere); 31 earth_sd->setColor(osg::Vec4(0, 0, 1.0, 1.0)); 32 32 33 osg::Geode* earth = new osg::Geode;34 earth->setName("earth");35 earth->addDrawable(earth_sd);33 osg::Geode* earth = new osg::Geode; 34 earth->setName("earth"); 35 earth->addDrawable(earth_sd); 36 36 37 // Create the Sun, in yellow38 osg::ShapeDrawable *sun_sd = new osg::ShapeDrawable;39 osg::Sphere* sun_sphere = new osg::Sphere;40 sun_sphere->setRadius(r_sun);41 sun_sd->setShape(sun_sphere);42 sun_sd->setColor(osg::Vec4(1.0, 0.0, 0.0, 1.0));37 // Create the Sun, in yellow 38 osg::ShapeDrawable *sun_sd = new osg::ShapeDrawable; 39 osg::Sphere* sun_sphere = new osg::Sphere; 40 sun_sphere->setRadius(r_sun); 41 sun_sd->setShape(sun_sphere); 42 sun_sd->setColor(osg::Vec4(1.0, 0.0, 0.0, 1.0)); 43 43 44 osg::Geode* sun = new osg::Geode;45 sun->setName("sun");46 sun->addDrawable(sun_sd);44 osg::Geode* sun = new osg::Geode; 45 sun->setName("sun"); 46 sun->addDrawable(sun_sd); 47 47 48 // Move the sun behind the earth49 osg::PositionAttitudeTransform *pat = new osg::PositionAttitudeTransform;50 pat->setPosition(osg::Vec3d(0.0, AU, 0.0));48 // Move the sun behind the earth 49 osg::PositionAttitudeTransform *pat = new osg::PositionAttitudeTransform; 50 pat->setPosition(osg::Vec3d(0.0, AU, 0.0)); 51 51 52 osg::Group* scene = new osg::Group;53 scene->addChild(earth);54 scene->addChild(pat);55 pat->addChild(sun);52 osg::Group* scene = new osg::Group; 53 scene->addChild(earth); 54 scene->addChild(pat); 55 pat->addChild(sun); 56 56 57 return scene;57 return scene; 58 58 } 59 59
