Drawing a 2D Line on the Center of the Screen

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

Drawing a 2D Line on the Center of the Screen

Hello,

I have two questions.
First, I want to draw a 2D line on the center of the screen independent from Spatial Reference.
Do you have any example source code?

Second, to do basic things like my first question above, is there any tutorial explaining the osgearth SDK( member classes and functions )?
I could not find anything except this short documentation on the link http://docs.osgearth.org/en/latest/

Best regards,
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Drawing a 2D Line on the Center of the Screen

Hi,

osgEarth is focused on geospatial rendering. Drawing geometry is an OpenSceneGraph function so you may want to ask your question on the osg-users forum (http://forum.openscenegraph.org/).

The docs site you found is the only documentation available. Someday it would be nice to set up a doxygen site but we don't have one at the moment.

Glenn Waldron / Pelican Mapping
aozdin aozdin
Reply | Threaded
Open this post in threaded view
|

Re: Drawing a 2D Line on the Center of the Screen

Okay, drawing a 2D line is an openscenegraph issue. What about positioning it on the center of the osgEarth display? I dont want to place my osg::Node object to any lat/lon/altitude. I want to position my osg::Node display's center.

osg::ref_ptr<osg::Node> nn  = createSceneGraph();//this function draws me a shape.
osgEarth::ModelLayer* m1 = new osgEarth::ModelLayer( "model1", nn.get() );
GeoTransform* geo = new GeoTransform();
geo->addChild( nn.get() );
geo->setPosition( osgEarth::GeoPoint( mapNode->getMapSRS(), 39.0, 32.0, 1200.0, ALTMODE_RELATIVE ) );
mapNode->addChild( geo );