Show
Ignore:
Timestamp:
11/15/04 20:44:35 (10 years ago)
Author:
robert
Message:

From osgplaents, updates to more of the solar systems planets.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgplanets/osgplanets.cpp

    r3589 r3634  
     1/* details about distances and rotation on http://www.solarviews.com/eng/solarsys.htm */ 
     2 
    13#include <iostream> 
    24 
     
    3436static osg::Vec3 centerScope(0.0f, 0.0f, 0.0f); 
    3537 
     38 
    3639/** create quad at specified position. */ 
    3740osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const osg::Vec3& height, osg::Image* image=NULL) 
     
    120123} 
    121124 
    122  
    123125osg::AnimationPath* createAnimationPath(const osg::Vec3& center,float radius,double looptime) 
    124126{ 
     
    149151 
    150152 
    151  
    152153class SolarSystem 
    153154{ 
    154155 
    155156public: 
     157    double _radiusSpace; 
    156158    double _radiusSun; 
     159    double _radiusMercury; 
     160    double _radiusVenus; 
    157161    double _radiusEarth; 
     162    double _radiusMoon; 
     163    double _radiusMars; 
     164    double _radiusJupiter; 
     165 
     166    double _RorbitMercury; 
     167    double _RorbitVenus; 
    158168    double _RorbitEarth; 
    159     double _tiltEarth; 
     169    double _RorbitMoon; 
     170    double _RorbitMars; 
     171    double _RorbitJupiter; 
     172 
     173    double _rotateSpeedMercury; 
     174    double _rotateSpeedVenus; 
    160175    double _rotateSpeedEarthAndMoon; 
    161176    double _rotateSpeedEarth; 
    162     double _radiusMoon; 
    163     double _RorbitMoon; 
    164177    double _rotateSpeedMoon; 
    165     double _radiusSpace; 
     178    double _rotateSpeedMars; 
     179    double _rotateSpeedJupiter; 
     180 
     181    double _tiltEarth; 
     182 
     183    std::string _mapSpace; 
     184    std::string _mapSun; 
     185    std::string _mapVenus;     
     186    std::string _mapMercury;     
     187    std::string _mapEarth; 
     188    std::string _mapEarthNight; 
     189    std::string _mapMoon; 
     190    std::string _mapMars; 
     191    std::string _mapJupiter; 
    166192     
    167193    SolarSystem() 
    168194    { 
    169         _radiusSun = 5.0; 
    170         _radiusEarth = 2.0; 
    171         _RorbitEarth = 10.0; 
    172         _tiltEarth = 18.0; 
    173         _rotateSpeedEarthAndMoon = 1.0; 
    174         _rotateSpeedEarth = 1.0; 
    175         _radiusMoon = 0.5; 
    176         _RorbitMoon = 2.0; 
    177         _rotateSpeedMoon = 1.0; 
    178         _radiusSpace = 300.0; 
    179     } 
    180      
    181     osg::MatrixTransform* createEarthTranslationAndTilt(); 
     195        _radiusSpace    = 300.0; 
     196        _radiusSun      = 3.5; 
     197        _radiusMercury  = 0.7; 
     198        _radiusVenus    = 1.2; 
     199        _radiusEarth    = 2.0; 
     200        _radiusMoon     = 0.5; 
     201        _radiusMars     = 1.8; 
     202        _radiusJupiter  = 1.8; 
     203         
     204        _RorbitMercury  = 11.7; 
     205        _RorbitVenus    = 21.6; 
     206        _RorbitEarth    = 30.0; 
     207        _RorbitMoon     = 2.0; 
     208        _RorbitMars     = 45.0; 
     209        _RorbitJupiter  = 156.0; 
     210         
     211        _rotateSpeedMercury         = 1.1; 
     212        _rotateSpeedVenus           = 1.3; 
     213        _rotateSpeedEarthAndMoon    = 1.0; 
     214        _rotateSpeedEarth           = 1.0; 
     215        _rotateSpeedMoon            = 1.2; 
     216        _rotateSpeedMars            = 1.2; 
     217        _rotateSpeedJupiter         = 1.2; 
     218 
     219        _tiltEarth                  = 18.0; // degrees 
     220         
     221        _mapSpace       = "Images/spacemap2.jpg"; 
     222        _mapSun         = "Images/Solarsystem/sun256128.jpg"; 
     223        _mapMercury     = "Images/Solarsystem/mercury256128.jpg"; 
     224        _mapVenus       = "Images/Solarsystem/venus256128.jpg"; 
     225        _mapEarth       = "Images/land_shallow_topo_2048.jpg"; 
     226        _mapEarthNight  = "Images/land_ocean_ice_lights_2048.jpg"; 
     227        _mapMoon        = "Images/Solarsystem/moon256128.jpg"; 
     228        _mapMars        = "Images/Solarsystem/mars256128.jpg"; 
     229        _mapJupiter     = "Images/Solarsystem/jupiter256128.jpg"; 
     230    } 
     231     
     232    osg::MatrixTransform* createTranslationAndTilt( double translation, double tilt ); 
    182233    osg::MatrixTransform* createRotation( double orbit, double speed ); 
    183     osg::MatrixTransform* createMoonTranslation(); 
     234     
    184235    osg::Geode* createSpace( const std::string& name, const std::string& textureName ); 
    185236    osg::Geode* createPlanet( double radius, const std::string& name, const osg::Vec4& color , const std::string& textureName ); 
    186237    osg::Geode* createPlanet( double radius, const std::string& name, const osg::Vec4& color , const std::string& textureName1, const std::string& textureName2); 
    187238    osg::Group* createSunLight(); 
    188     osg::Group* built(); 
    189      
    190     void printParameters() 
    191     { 
    192         std::cout << "radiusSun\t= " << _radiusSun << std::endl; 
    193         std::cout << "radiusEarth\t= " << _radiusEarth << std::endl; 
    194         std::cout << "RorbitEarth\t= " << _RorbitEarth << std::endl; 
    195         std::cout << "tiltEarth\t= " << _tiltEarth << std::endl; 
    196         std::cout << "rotateSpeedEarthAndMoon= " << _rotateSpeedEarthAndMoon     << std::endl; 
    197         std::cout << "rotateSpeedEarth= " << _rotateSpeedEarth << std::endl; 
    198         std::cout << "radiusMoon\t= " << _radiusMoon << std::endl; 
    199         std::cout << "RorbitMoon\t= " << _RorbitMoon << std::endl; 
    200         std::cout << "rotateSpeedMoon\t= " << _rotateSpeedMoon << std::endl; 
    201         std::cout << "radiusSpace\t= " << _radiusSpace << std::endl; 
    202          
    203     } 
    204      
     239     
     240    void printParameters(); 
     241         
    205242};  // end SolarSystem 
    206243 
     
    248285    SolarSystem solarSystem; 
    249286 
     287    while (arguments.read("--radiusSpace",solarSystem._radiusSpace)) { } 
    250288    while (arguments.read("--radiusSun",solarSystem._radiusSun)) { } 
    251289    while (arguments.read("--radiusEarth",solarSystem._radiusEarth)) { } 
     290    while (arguments.read("--radiusMoon",solarSystem._radiusMoon)) { } 
     291     
    252292    while (arguments.read("--RorbitEarth",solarSystem._RorbitEarth)) { } 
    253     while (arguments.read("--tiltEarth",solarSystem._tiltEarth)) { } 
     293    while (arguments.read("--RorbitMoon",solarSystem._RorbitMoon)) { } 
     294     
    254295    while (arguments.read("--rotateSpeedEarthAndMoon",solarSystem._rotateSpeedEarthAndMoon)) { } 
    255296    while (arguments.read("--rotateSpeedEarth",solarSystem._rotateSpeedEarth)) { } 
    256     while (arguments.read("--radiusMoon",solarSystem._radiusMoon)) { } 
    257     while (arguments.read("--RorbitMoon",solarSystem._RorbitMoon)) { } 
    258297    while (arguments.read("--rotateSpeedMoon",solarSystem._rotateSpeedMoon)) { } 
    259     while (arguments.read("--radiusSpace",solarSystem._radiusSpace)) { } 
     298    while (arguments.read("--tiltEarth",solarSystem._tiltEarth)) { } 
     299     
     300    while (arguments.read("--mapSpace",solarSystem._mapSpace)) { } 
     301    while (arguments.read("--mapEarth",solarSystem._mapEarth)) { } 
     302    while (arguments.read("--mapEarthNight",solarSystem._mapEarthNight)) { } 
     303    while (arguments.read("--mapMoon",solarSystem._mapMoon)) { } 
     304     
    260305     
    261306     
     
    299344    { 
    300345        std::cout << "setup the following arguments: " << std::endl; 
     346        std::cout << "--radiusSpace: double" << std::endl; 
    301347        std::cout << "--radiusSun: double" << std::endl; 
    302348        std::cout << "--radiusEarth: double" << std::endl; 
     349        std::cout << "--radiusMoon: double" << std::endl; 
     350         
    303351        std::cout << "--RorbitEarth: double" << std::endl; 
    304         std::cout << "--tiltEarth: double" << std::endl; 
     352        std::cout << "--RorbitMoon: double" << std::endl; 
     353         
    305354        std::cout << "--rotateSpeedEarthAndMoon: double" << std::endl; 
    306355        std::cout << "--rotateSpeedEarth: double" << std::endl; 
    307         std::cout << "--radiusMoon: double" << std::endl; 
    308         std::cout << "--RorbitMoon: double" << std::endl; 
    309356        std::cout << "--rotateSpeedMoon: double" << std::endl; 
    310         std::cout << "--radiusSpace: double" << std::endl; 
    311          
    312                  
     357        std::cout << "--tiltEarth: double" << std::endl; 
     358         
     359        std::cout << "--mapSpace: string" << std::endl; 
     360        std::cout << "--mapEarth: string" << std::endl; 
     361        std::cout << "--mapEarthNight: string" << std::endl; 
     362        std::cout << "--mapMoon: string" << std::endl; 
     363                         
    313364        return 1; 
    314365    } 
     
    331382 
    332383    // create the sun 
    333     osg::Node* sun = solarSystem.createPlanet( solarSystem._radiusSun, "Sun", osg::Vec4( 1.0, 1.0, 0, 1.0f), "" ); 
     384    osg::Node* sun = solarSystem.createPlanet( solarSystem._radiusSun, "Sun", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), solarSystem._mapSun ); 
    334385    osg::StateSet* sunStateSet = sun->getOrCreateStateSet(); 
    335386    osg::Material* material = new osg::Material; 
    336387    material->setEmission( osg::Material::FRONT_AND_BACK, osg::Vec4( 1.0f, 1.0f, 0.0f, 0.0f ) ); 
    337388    sunStateSet->setAttributeAndModes( material, osg::StateAttribute::ON ); 
    338      
     389 
    339390    osg::Billboard* sunBillboard = new osg::Billboard(); 
    340391    sunBillboard->setMode(osg::Billboard::POINT_ROT_EYE); 
     
    344395         
    345396    sunLight->addChild( sunBillboard ); 
    346      
    347      
     397 
    348398    // stick sun right under root, no transformations for the sun 
    349399    sunLight->addChild( sun ); 
     
    351401    // create light source in the sun 
    352402 
     403/* 
     404********************************************* 
     405**  earthMoonGroup and Transformations  
     406********************************************* 
     407*/ 
    353408    // create earth and moon 
    354     osg::Node* earth = solarSystem.createPlanet( solarSystem._radiusEarth, "Earth", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), "Images/land_shallow_topo_2048.jpg", "Images/land_ocean_ice_lights_2048.jpg" ); 
    355     osg::Node* moon = solarSystem.createPlanet( solarSystem._radiusMoon, "Moon", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), "Images/moon256128.TGA" ); 
     409    osg::Node* earth = solarSystem.createPlanet( solarSystem._radiusEarth, "Earth", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), solarSystem._mapEarth, solarSystem._mapEarthNight ); 
     410    osg::Node* moon = solarSystem.createPlanet( solarSystem._radiusMoon, "Moon", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), solarSystem._mapMoon ); 
    356411 
    357412    // create transformations for the earthMoonGroup 
    358     osg::MatrixTransform* aroundSunRotation = solarSystem.createRotation( solarSystem._RorbitEarth, solarSystem._rotateSpeedEarthAndMoon ); 
    359     osg::MatrixTransform* earthPosition = solarSystem.createEarthTranslationAndTilt(); 
     413    osg::MatrixTransform* aroundSunRotationEarthMoonGroup = solarSystem.createRotation( solarSystem._RorbitEarth, solarSystem._rotateSpeedEarthAndMoon ); 
     414    osg::MatrixTransform* earthMoonGroupPosition = solarSystem.createTranslationAndTilt( solarSystem._RorbitEarth, solarSystem._tiltEarth ); 
    360415 
    361416 
     
    365420 
    366421    //transformation to rotate the earth around itself 
    367     osg::MatrixTransform* earthRotationAroundItself = solarSystem.createRotation ( 0.0, solarSystem._rotateSpeedEarth ); 
     422    osg::MatrixTransform* earthAroundItselfRotation = solarSystem.createRotation ( 0.0, solarSystem._rotateSpeedEarth ); 
    368423 
    369424    //transformations for the moon 
    370     osg::MatrixTransform* moonAroundEarthXform = solarSystem.createRotation( solarSystem._RorbitMoon, solarSystem._rotateSpeedMoon ); 
    371     osg::MatrixTransform* moonTranslation = solarSystem.createMoonTranslation(); 
     425    osg::MatrixTransform* moonAroundEarthRotation = solarSystem.createRotation( solarSystem._RorbitMoon, solarSystem._rotateSpeedMoon ); 
     426    osg::MatrixTransform* moonTranslation = solarSystem.createTranslationAndTilt( solarSystem._RorbitMoon, 0.0f ); 
    372427 
    373428 
    374429    moonTranslation->addChild( moon ); 
    375     moonAroundEarthXform->addChild( moonTranslation ); 
    376     earthMoonGroup->addChild( moonAroundEarthXform ); 
    377  
    378     earthRotationAroundItself->addChild( earth ); 
    379  
    380     earthMoonGroup->addChild( earthRotationAroundItself ); 
    381  
    382     earthPosition->addChild( earthMoonGroup ); 
    383  
    384     aroundSunRotation->addChild( earthPosition ); 
    385  
    386     sunLight->addChild( aroundSunRotation ); 
    387  
    388 #if 0 
     430    moonAroundEarthRotation->addChild( moonTranslation ); 
     431    earthMoonGroup->addChild( moonAroundEarthRotation ); 
     432 
     433    earthAroundItselfRotation->addChild( earth ); 
     434 
     435    earthMoonGroup->addChild( earthAroundItselfRotation ); 
     436 
     437    earthMoonGroupPosition->addChild( earthMoonGroup ); 
     438 
     439    aroundSunRotationEarthMoonGroup->addChild( earthMoonGroupPosition ); 
     440 
     441    sunLight->addChild( aroundSunRotationEarthMoonGroup ); 
     442/* 
     443********************************************* 
     444**  end earthMoonGroup and Transformations  
     445********************************************* 
     446*/ 
     447 
     448/* 
     449********************************************* 
     450**  Mercury and Transformations  
     451********************************************* 
     452*/ 
     453    osg::Node* mercury = solarSystem.createPlanet( solarSystem._radiusMercury, "Mercury", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f ), solarSystem._mapMercury, "" ); 
     454     
     455    osg::MatrixTransform* aroundSunRotationMercury = solarSystem.createRotation( solarSystem._RorbitMercury, solarSystem._rotateSpeedMercury ); 
     456    osg::MatrixTransform* mercuryPosition = solarSystem.createTranslationAndTilt( solarSystem._RorbitMercury, 0.0f ); 
     457     
     458    mercuryPosition->addChild( mercury ); 
     459    aroundSunRotationMercury->addChild( mercuryPosition ); 
     460     
     461    sunLight->addChild( aroundSunRotationMercury ); 
     462/* 
     463********************************************* 
     464**  end Mercury and Transformations  
     465********************************************* 
     466*/ 
     467 
     468/* 
     469********************************************* 
     470**  Venus and Transformations  
     471********************************************* 
     472*/ 
     473    osg::Node* venus = solarSystem.createPlanet( solarSystem._radiusVenus, "Venus", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f ), solarSystem._mapVenus, "" ); 
     474     
     475    osg::MatrixTransform* aroundSunRotationVenus = solarSystem.createRotation( solarSystem._RorbitVenus, solarSystem._rotateSpeedVenus ); 
     476    osg::MatrixTransform* venusPosition = solarSystem.createTranslationAndTilt( solarSystem._RorbitVenus, 0.0f ); 
     477     
     478    venusPosition->addChild( venus ); 
     479    aroundSunRotationVenus->addChild( venusPosition ); 
     480     
     481    sunLight->addChild( aroundSunRotationVenus ); 
     482/* 
     483********************************************* 
     484**  end Venus and Transformations  
     485********************************************* 
     486*/ 
     487 
     488/* 
     489********************************************* 
     490**  Mars and Transformations  
     491********************************************* 
     492*/ 
     493    osg::Node* mars = solarSystem.createPlanet( solarSystem._radiusMars, "Mars", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f ), solarSystem._mapMars, "" ); 
     494     
     495    osg::MatrixTransform* aroundSunRotationMars = solarSystem.createRotation( solarSystem._RorbitMars, solarSystem._rotateSpeedMars ); 
     496    osg::MatrixTransform* marsPosition = solarSystem.createTranslationAndTilt( solarSystem._RorbitMars, 0.0f ); 
     497     
     498    marsPosition->addChild( mars ); 
     499    aroundSunRotationMars->addChild( marsPosition ); 
     500     
     501    sunLight->addChild( aroundSunRotationMars ); 
     502/* 
     503********************************************* 
     504**  end Mars and Transformations  
     505********************************************* 
     506*/ 
     507 
     508/* 
     509********************************************* 
     510**  Jupiter and Transformations  
     511********************************************* 
     512*/ 
     513    osg::Node* jupiter = solarSystem.createPlanet( solarSystem._radiusJupiter, "Jupiter", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f ), solarSystem._mapJupiter, "" ); 
     514     
     515    osg::MatrixTransform* aroundSunRotationJupiter = solarSystem.createRotation( solarSystem._RorbitJupiter, solarSystem._rotateSpeedJupiter ); 
     516    osg::MatrixTransform* jupiterPosition = solarSystem.createTranslationAndTilt( solarSystem._RorbitJupiter, 0.0f ); 
     517     
     518    jupiterPosition->addChild( jupiter ); 
     519    aroundSunRotationJupiter->addChild( jupiterPosition ); 
     520     
     521    sunLight->addChild( aroundSunRotationJupiter ); 
     522/* 
     523********************************************* 
     524**  end Jupiter and Transformations  
     525********************************************* 
     526*/ 
     527 
     528/* 
    389529    // add space, but don't light it, as its not illuminated by our sun 
    390     osg::Node* space = solarSystem.createSpace( "Space", "Images/spacemap.jpg" ); 
     530    osg::Node* space = solarSystem.createSpace( "Space", solarSystem._mapSpace ); 
    391531    space->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); 
    392532    root->addChild( space ); 
    393 #endif 
    394     
     533*/     
     534      
    395535    // run optimization over the scene graph 
    396536    osgUtil::Optimizer optimzer; 
    397     //optimzer.optimize( dynamic_cast<osg::CoordinateSystemNode*>( root.get() ) ); 
    398537    optimzer.optimize( root ); 
    399538      
     
    403542 
    404543    // set up tracker manipulators, once for each astral body 
    405     { 
    406         FindNamedNodeVisitor fnnv("Sun"); 
     544     
     545    { 
     546        FindNamedNodeVisitor fnnv("Moon"); 
    407547        root->accept(fnnv); 
    408548 
     
    421561 
    422562    { 
    423         FindNamedNodeVisitor fnnv("Moon"); 
     563        FindNamedNodeVisitor fnnv("Earth"); 
    424564        root->accept(fnnv); 
    425565 
     
    436576        } 
    437577    }     
    438  
    439     { 
    440         FindNamedNodeVisitor fnnv("Earth"); 
     578     
     579    { 
     580        FindNamedNodeVisitor fnnv("Sun"); 
    441581        root->accept(fnnv); 
    442582 
     
    473613    } 
    474614     
     615     
    475616    // wait for all cull and draw threads to complete before exit. 
    476617    viewer.sync(); 
     
    478619    return 0; 
    479620}// end main 
    480  
    481  
    482 osg::MatrixTransform* SolarSystem::createEarthTranslationAndTilt()  
    483 { 
    484         osg::MatrixTransform* earthPositioned = new osg::MatrixTransform; 
    485         earthPositioned->setMatrix(osg::Matrix::translate(osg::Vec3( 0.0, _RorbitEarth, 0.0 ) )* 
    486                                      osg::Matrix::scale(1.0, 1.0, 1.0)* 
    487                                      osg::Matrix::rotate(osg::inDegrees( _tiltEarth ),0.0f,0.0f,1.0f)); 
    488  
    489         return earthPositioned; 
    490 }// end SolarSystem::createEarthTranslationAndTilt 
    491621 
    492622 
     
    504634 
    505635 
    506 osg::MatrixTransform* SolarSystem::createMoonTranslation() 
     636osg::MatrixTransform* SolarSystem::createTranslationAndTilt( double translation, double tilt ) 
    507637{ 
    508638    osg::MatrixTransform* moonPositioned = new osg::MatrixTransform; 
    509639    moonPositioned->setMatrix(osg::Matrix::translate(osg::Vec3( 0.0, _RorbitMoon, 0.0 ) )* 
    510640                                 osg::Matrix::scale(1.0, 1.0, 1.0)* 
    511                                  osg::Matrix::rotate(osg::inDegrees(0.0f),0.0f,0.0f,1.0f)); 
     641                                 osg::Matrix::rotate(osg::inDegrees( tilt ),0.0f,0.0f,1.0f)); 
    512642 
    513643    return moonPositioned; 
    514 }// end SolarSystem::createMoonTranslation 
     644}// end SolarSystem::createTranslationAndTilt 
    515645     
    516646     
     
    694824}// end SolarSystem::createSunLight 
    695825     
    696  
    697 /* 
    698 osg::Group* SolarSystem::built() 
    699 { 
    700     osg::Group* thisSystem = new osg::Group; 
    701  
    702     // create light source in the sun 
    703     osg::Group* sunLight = createSunLight(); 
    704     thisSystem->addChild( sunLight ); 
    705  
    706  
    707     // create the sun 
    708     osg::Node* sun = createPlanet( _radiusSun, "Sun", osg::Vec4( 0, 0, 0, 1.0f), "" ); 
    709     osg::StateSet* sunStateSet = sun->getOrCreateStateSet(); 
    710     osg::Material* material = new osg::Material; 
    711     material->setEmission( osg::Material::FRONT_AND_BACK, osg::Vec4( 1.0f, 1.0f, 0.0f, 0.0f ) ); 
    712     sunStateSet->setAttributeAndModes( material, osg::StateAttribute::ON ); 
    713  
    714     if( !sun ) 
    715     { 
    716         std::cout << "Sonne konnte nicht erstellt werden!" << std::endl; 
    717         exit(0); 
    718     } 
    719     sun->setStateSet( sunStateSet ); 
    720  
    721     // stick sun right under root, no transformations for the sun 
    722     sunLight->addChild(sun); 
    723  
    724  
    725     //creating right side of the graph with earth and moon and the rotations above it 
    726  
    727     // create earth and moon 
    728     osg::Node* earth = createPlanet( _radiusEarth, "Earth", osg::Vec4( 0.0f, 0.0f, 1.0f, 1.0f), "Images/land_shallow_topo_2048.jpg" ); 
    729     osg::Node* moon = createPlanet( _radiusMoon, "Moon", osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), "Images/moon256128.TGA" ); 
    730  
    731     // create transformations for the earthMoonGroup 
    732     osg::MatrixTransform* aroundSunRotation = createRotation( _RorbitEarth, _rotateSpeedEarthAndMoon ); 
    733     osg::MatrixTransform* earthPosition = createEarthTranslationAndTilt( _RorbitEarth, _tiltEarth ); 
    734  
    735     //Group with earth and moon under it 
    736     osg::Group* earthMoonGroup = new osg::Group; 
    737  
    738     //transformation to rotate the earth around itself 
    739     osg::MatrixTransform* earthRotationAroundItself = createRotation ( 0.0, _rotateSpeedEarth ); 
    740  
    741     //transformations for the moon 
    742     osg::MatrixTransform* moonAroundEarthXform = createRotation( _RorbitMoon, _rotateSpeedMoon ); 
    743     osg::MatrixTransform* moonTranslation = createMoonTranslation( _RorbitMoon ); 
    744  
    745  
    746     moonTranslation->addChild( moon ); 
    747     moonAroundEarthXform->addChild( moonTranslation ); 
    748     earthMoonGroup->addChild( moonAroundEarthXform ); 
    749  
    750     earthRotationAroundItself->addChild( earth ); 
    751  
    752     earthMoonGroup->addChild( earthRotationAroundItself ); 
    753  
    754     earthPosition->addChild( earthMoonGroup ); 
    755  
    756  
    757     aroundSunRotation->addChild( earthPosition ); 
    758  
    759     sunLight->addChild( aroundSunRotation ); 
    760  
    761     // add space, but don't light it, as its not illuminated by our sun 
    762     osg::Node* space = createSpace( _radiusSpace, "Space", "Images/spacemap.jpg" ); 
    763     space->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); 
    764     thisSystem->addChild( space ); 
    765  
    766     return( thisSystem ); 
    767 }// end SolarSystem::built() 
    768 */ 
     826void SolarSystem::printParameters() 
     827{ 
     828    std::cout << "radiusSpace(" << _radiusSpace << ")" << std::endl; 
     829    std::cout << "radiusSun(" << _radiusSun << ")" << std::endl; 
     830    std::cout << "radiusEarth(" << _radiusEarth << ")" << std::endl; 
     831    std::cout << "radiusMoon(" << _radiusMoon << ")" << std::endl; 
     832 
     833    std::cout << "RorbitEarth(" << _RorbitEarth << ")" << std::endl; 
     834    std::cout << "RorbitMoon(" << _RorbitMoon << ")" << std::endl; 
     835 
     836    std::cout << "rotateSpeedEarthAndMoon(" << _rotateSpeedEarthAndMoon << ")" << std::endl; 
     837    std::cout << "rotateSpeedEarth(" << _rotateSpeedEarth << ")" << std::endl; 
     838    std::cout << "rotateSpeedMoon(" << _rotateSpeedMoon << ")" << std::endl; 
     839    std::cout << "tiltEarth(" << _tiltEarth << ")" << std::endl; 
     840 
     841    std::cout << "mapSpace(" << _radiusSpace << ")" << std::endl; 
     842    std::cout << "mapEarth(" << _radiusSpace << ")" << std::endl; 
     843    std::cout << "mapEarthNight(" << _radiusSpace << ")" << std::endl; 
     844    std::cout << "mapMoon(" << _radiusSpace << ")" << std::endl; 
     845}