[osg-users] OSG Ellipsoid to Sphere Conversion

Robert Osfield robert.osfield at gmail.com
Tue Sep 27 00:15:16 PDT 2016

Hi Inna,

On 26 September 2016 at 22:42, Inna Reddy <osgforum at tevs.eu> wrote:
> Thanks for the reply. Sorry , Seems  I explained very badly . Well , my issue is that I want to make sphere  and text on it. I was able to do with the EllipsoidModel and using log , lat and height. I want to do the same with same Sphere. But I dont have idea how to do with sphere the same thing. I want to make sphere with radius which varys basing on the screen coordinates. In osg::Sphere I can see setradius(), but how can i set radius to screen coordinates ?

The osg::Sphere class is just a shape primitive it just provides a
position and a radius, the coordinate frame all depends on how you
want to use that data.

Computing positions on a sphere is easy, just a matter of sin and cos.
Do you need help with this?  There are plenty of guides on line on how
to do trigonometry of spheres.

Finally on the screen coordinate side, you'll need to give us some
context.  Are you trying to visualize the sphere?  In screen
coordinates?  Or are you just trying to map mouse coordinates to an
intersection point on geometry in the scene that you then attach a bit
of text to?


More information about the osg-users mailing list