Geometry to the Scene

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

Geometry to the Scene

Hi,

I need to create a compass like a camera, then bounding the camera heading and pitch to a label located on the scene.

Then, I'm able to do it, using the Control class as in the image

The idea was to create a Control canvas with controls like hbox and Labels.

The goal it's to create a telemetry like in the image:



And I tried to insert in the HBOX control a simple geometry or a featureNode with LineString, but I failed.

What is your advice?

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Geometry to the Scene

Hello,
My advise is to write your own code to do it. The "Controls" classes in osgEarth exist only to support the SDK demos. You can use them if you want but they are minimal and we do not support them. In fact we are moving toward using ImGui for demos instead and Controls will eventually go away.
Glenn Waldron / Pelican Mapping
marcoma9023 marcoma9023
Reply | Threaded
Open this post in threaded view
|

Re: Geometry to the Scene

Hi,

I built the telemetry compass using the osg objects. In particular the root object it's geode, that contains osgText and osg::Geometry....

Then, launching an osg application, I can see correctly the telemetry as you can see in the image



where the code in case of osg test is:

osg::Group* root= new osg::Group;

int width = 400; //px
int height = 40; //px

Telemetry* ruler = new Telemetry(width, height);
ruler->updateTelemetry(HFOV, pan);

        // rotate the scalar from XY plane to XZ so we see them viewing it with the default camera manipulators that look along the Y axis, with Z up.
osg::MatrixTransform* transform = new osg::MatrixTransform;
group->addChild(transform);
transform->setMatrix(osg::Matrix::rotate(osg::inDegrees(90.0), 1.0, 0.0, 0.0));
transform->addChild(ruler);
//transform->addChild(createScalarBar(false));


// add model to viewer.
viewer.setSceneData(group);

Then, since I need to insert the node "Telemetry" in the osgEarth application, I insert the node as child of root node....

The problem is that in this case the telemetry is not shown, why?

I need to define some properties for Telemetry (geode)?