[osg-users] Create circle osgEarth

258 views
Skip to first unread message

Marco Pompei

unread,
Jul 6, 2016, 3:30:43 AM7/6/16
to osg-...@lists.openscenegraph.org
Hi,
I am using osgEarth (derivated by OSG) to develop an application for drawing several geometry on earth.

I need to draw a circle (and I know how i can do it, using CircleNode class) but no resizable. I mean that I zoom in/out the earth and I'd like the circle area don't change. Unfortunately, constructor of this class, wants value for radius and when I zoom out/in the circle area decrease/increase because its radius keeps constant.

Any advice for me?
Thank you!

Cheers,
Marco

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





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Trajce Nikolov NICK

unread,
Jul 6, 2016, 3:39:55 AM7/6/16
to OpenSceneGraph Users
you can use osg::AutoTransform on top of your circle
--
trajce nikolov nick

Glenn Waldron

unread,
Jul 6, 2016, 9:30:19 AM7/6/16
to OpenSceneGraph Users
Marco,
You can use the GeoPositionNodeAutoScaler cull callback on your CircleNode, assuming you are using a recent osgEarth.

(For osgEarth-specific questions, you can use the osgEarth support forum at http://forum.osgearth.org)


Glenn Waldron

Marco Pompei

unread,
Jul 16, 2016, 3:36:34 AM7/16/16
to osg-...@lists.openscenegraph.org
Hi,
thank you for reply. I googled and found out any example about this. but, I have a doubt about osg::AutoTransform: I saw this get the position by a Vec3 but circleNode get his position by GeoPosition:

Assuming this:
osg::AutoTrasform at = new ....
at->pos( Vec3 )
CircleNode myCircle = new CircleNode(.... GeoPosition(lat/lon) .... );
.....
at->addChild(myCircle)

1. What are represent the values I set up in Vec3 in terms of position? (lat/lon, coordinates or other??)
2. GeoPosition get lat/lon but if I have already set up Vec3 position for "at" which is going to position he choose to draw?


The last:
Now, thanks annotation callback I receive my circle node and his AnnotationData I defined. I saw AutoTrasform doesn't have setAnnotationData. If I do at->addChild(myCircleNode) and group->addChild(at) I aspect to receive "at" as Annotation (is it correct??). How can I extract any AnnotationData by this?

Many
Thank

[quote="Trajce Nikolov NICK"]you can use osg::AutoTransform on top of your circle

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

Marco Pompei

unread,
Jul 16, 2016, 3:41:47 AM7/16/16
to osg-...@lists.openscenegraph.org
Hi GWaldron,
thank you for your help and thank to indicate me right forum for osg::Earth. i ll write there as well. Unfortunately i didn't get how i can use it cause i didn't find any documentation about it.

Do you have any example?

Thank you
M.


gwaldron wrote:
> Marco,You can use the GeoPositionNodeAutoScaler cull callback on your CircleNode, assuming you are using a recent osgEarth.
>
>
> (For osgEarth-specific questions, you can use the osgEarth support forum at http://forum.osgearth.org (http://forum.osgearth.org))
>
>
>
> Glenn Waldron
>
>
>
>
> On Tue, Jul 5, 2016 at 2:43 PM, Marco Pompei < ()> wrote:
>
> > Hi,
> > I am using osgEarth (derivated by OSG) to develop an application for drawing several geometry on earth.
> >
> > I need to draw a circle (and I know how i can do it, using CircleNode class) but no resizable. I mean that I zoom in/out the earth and I'd like the circle area don't change. Unfortunately, constructor of this class, wants value for radius and when I zoom out/in the circle area decrease/increase because its radius keeps constant.
> >
> > Any advice for me?
> > Thank you!
> >
> > Cheers,
> > Marco
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=68010#68010 (http://forum.openscenegraph.org/viewtopic.php?p=68010#68010)
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
>
>
> ------------------
> Post generated by Mail2Forum


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

Glenn Waldron

unread,
Jul 17, 2016, 3:06:56 PM7/17/16
to OpenSceneGraph Users

Glenn Waldron

Marco Pompei

unread,
Jul 19, 2016, 3:48:38 PM7/19/16
to osg-...@lists.openscenegraph.org
Hi Glenn,
i tried that function but i didn't find it... it may be i am not using recent osgEarth. I d like to get another way: i saw that CircleNode has setRadius() and i can use this to draw more times. To resize the i d need to know some ABSOLUTE NUMBER for example distance of projection of the camera to sea level.

Is it possibile getting this value?

Please help me.... I am getting crazy javascript&#058;emoticon(':\'') javascript&#058;emoticon(':\'')
javascript&#058;emoticon(':)')

gwaldron wrote:
> The header file has information on how to use it.
>

> https://github.com/gwaldron/osgearth/blob/master/src/osgEarthAnnotation/GeoPositionNodeAutoScaler (https://github.com/gwaldron/osgearth/blob/master/src/osgEarthAnnotation/GeoPositionNodeAutoScaler)


>
>
> Glenn Waldron
>
>
>
>
> On Sat, Jul 16, 2016 at 3:50 AM, Marco Pompei < ()> wrote:
>
> > Hi GWaldron,
> > thank you for your help and thank to indicate me right forum for osg::Earth. i ll write there as well. Unfortunately i didn't get how i can use it cause i didn't find any documentation about it.
> >
> > Do you have any example?
> >
> > Thank you
> > M.
> >
> >
> > gwaldron wrote:
> >
> > > Marco,You can use the GeoPositionNodeAutoScaler cull callback on your CircleNode, assuming you are using a recent osgEarth.
> > >
> > >

> > > (For osgEarth-specific questions, you can use the osgEarth support forum at http://forum.osgearth.org (http://forum.osgearth.org) (http://forum.osgearth.org (http://forum.osgearth.org)))


> > >
> > >
> > >
> > > Glenn Waldron
> > >
> > >
> > >
> > >
> > > On Tue, Jul 5, 2016 at 2:43 PM, Marco Pompei < ()> wrote:
> > >
> > >
> > > > Hi,
> > > > I am using osgEarth (derivated by OSG) to develop an application for drawing several geometry on earth.
> > > >
> > > > I need to draw a circle (and I know how i can do it, using CircleNode class) but no resizable. I mean that I zoom in/out the earth and I'd like the circle area don't change. Unfortunately, constructor of this class, wants value for radius and when I zoom out/in the circle area decrease/increase because its radius keeps constant.
> > > >
> > > > Any advice for me?
> > > > Thank you!
> > > >
> > > > Cheers,
> > > > Marco
> > > >
> > > > ------------------
> > > > Read this topic online here:

> > > > http://forum.openscenegraph.org/viewtopic.php?p=68010#68010 (http://forum.openscenegraph.org/viewtopic.php?p=68010#68010) (http://forum.openscenegraph.org/viewtopic.php?p=68010#68010 (http://forum.openscenegraph.org/viewtopic.php?p=68010#68010))


> > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > osg-users mailing list
> > > >   ()

> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))


> > > >
> > > >
> > >
> > >
> > >   ------------------
> > > Post generated by Mail2Forum
> > >
> >
> >
> > ------------------
> > Read this topic online here:

> > http://forum.openscenegraph.org/viewtopic.php?p=68149#68149 (http://forum.openscenegraph.org/viewtopic.php?p=68149#68149)


> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> >
> >
> >
>
>
> ------------------
> Post generated by Mail2Forum
:' :' :' :' :' :'

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=68175#68175

Reply all
Reply to author
Forward
0 new messages