osgEarth::Annotation::ModelNode vs osg::Node

classic Classic list List threaded Threaded
3 messages Options
ceranco ceranco
Reply | Threaded
Open this post in threaded view
|

osgEarth::Annotation::ModelNode vs osg::Node

Hello osgEarth community,

I have been trying to understand the difference between using a ModelNode and using a regular Node.
For example, to load a model with the ModelNode:

Style style;
style.getOrCreate<ModelSymbol>()->url()->setLiteral("../data/tank.ive");
ModelNode* modelNode = new ModelNode(mapNode, style);


vs using osg::Node and osgEarth::GeoTransform

osg::Node* model = osgDB::readRefNodeFile("../data/tank.ive.osgearth_shadergen");
GeoTransform* geoTranform = new GeoTransform();
PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform();
pat->addChild(model);
geo->addChild(pat);


My use case is dynamically loading and moving models at runtime.
Can the ModelNode share the loaded model with other ModelNodes?
What are the differences between them?

Thanks,
Eran Cohen
Eran Cohen
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Annotation::ModelNode vs osg::Node

Eran,

ModelNode is a class that enables creation of a positioned model from an earth file (see annotation.earth for usage example), including the processing of associated symbology.

For your use case, using a GeoTransform etc. directly is a fine approach.
Glenn Waldron / Pelican Mapping
ceranco ceranco
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Annotation::ModelNode vs osg::Node

Glenn,
Thank you for answering!

Cheers,
Eran Cohen
Eran Cohen