[osg-users] adding object models in osgEarth best practices

Eran Cohen ceranco at gmail.com
Thu May 2 11:14:05 PDT 2019


Hi David,

It would help if you post the code that doesn't work for you so that we can see whats wrong with it.

Have you set its location using a GeoPoint?


Code:


auto model = osgDB::readNodeFile("path-to-model");

auto geoTransform = new osgEarth::GeoTransform;
geoTransform->addChild(model);

// This sets the location to New ork at an altitude of 1000 meters
auto srs = osgEarth::SpatialReference::get("wgs84);
GeoPoint newYork(srs, -73.935242, 40.730610, 1000);
geoTransform->setLocation(newYork);


... 




If this isn't the problem then reply with a snippet of the code that isn't working.

Cheers,
Eran

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75940#75940







More information about the osg-users mailing list