how to use SkyNode correctly in oe2.7?

classic Classic list List threaded Threaded
2 messages Options
ldj ldj
Reply | Threaded
Open this post in threaded view
|

how to use SkyNode correctly in oe2.7?

This post was updated on .
CONTENTS DELETED
The author has deleted this message.
kefir kefir
Reply | Threaded
Open this post in threaded view
|

Re: how to use SkyNode correctly in oe2.7?

This one works for me

// Create sky
osgEarth::SimpleSky::SimpleSkyOptions skyOptions;
skyOptions.moonImageURI() = "some_path/moon_1024x512.jpg";
//    skyOptions.ambient() = 0.07f;
//    skyOptions.exposure() = 0.5f;
//    skyOptions.atmosphericLighting() = false;

sky = SkyNode::create(skyOptions);
sky->setAtmosphereVisible(true);
sky->setStarsVisible(true);
sky->setMoonVisible(true);
//    sky->setMinimumAmbient();

sky->setDateTime(DateTime(QDateTime::currentDateTime().toTime_t()));

mapNode->addChild(sky);

//sun and moon
sunPosNode = new PlaceNode();
sunPosNode->setDynamic(true);
mapNode->addChild(sunPosNode);

moonPosNode = new PlaceNode();
moonPosNode->setDynamic(true);
mapNode->addChild(moonPosNode);

ephemeris = sky->getEphemeris();

// Add phong lighting.
phong = new PhongLightingEffect();