[osg-users] OSG Ellipsoid to Sphere Conversion

Inna Reddy osgforum at tevs.eu
Mon Sep 26 10:05:14 PDT 2016

Hi all, 

I am a new bie here. I was playing with some examples. From the FadeText Example http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgfadetext/osgfadetext.cpp .  In this example, I have the ellipsoid model from the lat, long and height. It's clear, then I tried to change this to Sphere. For me it seems, not possible to convert the Elliposid to sphere. 

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);
		osgText::Text* text = new osgText::FadeText;	
		text->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX);
		osg::Vec3 normal = ellipsoid->computeLocalUpVector(X, Y, Z);
		text->setCullCallback(new osg::ClusterCullingCallback(osg::Vec3(X, Y, Z), normal, 0.0));


 I am out of ideas, to do this possible to make same thing with sphere. Could youe please some one help me to do this. 

thanks and cheers, 
Inna [/code]

Read this topic online here:

More information about the osg-users mailing list