0
votes

I have been practicing some openSceneGraph examples provided by OSG. One of the example, I came across text on the ellipsoid.

osgText::Text* createText(osg::EllipsoidModel* ellipsoid, double latitude, double longitude, double height, const std::string& str)
{
    double X, Y, Z;
    ellipsoid->convertLatLongHeightToXYZ(osg::DegreesToRadians(latitude), osg::DegreesToRadians(longitude), height, X, Y, Z);

This works well in my case.then I thought to do the same with the sphere. In this example, the ellipsoid drawn basing on the lat, long and height. I want to draw the sphere with radius which depends on the window size / screen size. Unfortunately I failed to see which converts the screen coordinates to sphere size in the osg::Sphere class.

Some one can help me, to solve this. There might be some thing which converts this, may be i did not come across because of my less experience.

Cheers, Inna.

1

1 Answers

0
votes

osg::Sphere is not a geospatial model like osg::EllipsoidModel.

Just create an osg::EllipsoidModel with both Radii (equator and polar) the same as the sphere radius you wish, and use osg::EllipsoidModel.