[osg-users] Unable to place model on vpb terrain. How To ?
gwaldron at gmail.com
Sat Apr 9 10:07:25 PDT 2011
The method won't work because your VPB database is not geocentric. It is
projected (UTM). A non-geocetric db won't have an EllipsoidModel.
Setting an EM won't work. The EllipsoidModel conversion methods only convert
between geodetic (lat/long) and geocentric.
The conversion works in osgEarth because osgEarth automatically detects the
terrain's coordinate system and knows how to convert between UTM, geodetic,
Bottom line is, you cannot place something on your UTM database using
lat/long coordinates without first converting lat/long to UTM.
Glenn Waldron / Pelican Mapping / 703.652.4791 / @glennwaldron
On Fri, Apr 8, 2011 at 2:10 PM, Sanat Talmaki <sanat.schumi at gmail.com>wrote:
> I am trying to place a model on a vpb terrain by supplying the lat-long
> I followed a couple of threads in the forum that suggested to use the
> CoordinateSystemNode and ellipsoid model. But that didn't work for me (or
> maybe I am not following it right).
> I have attached the terrain along with my post.
> So far this is what I am doing:
> osg::ref_ptr<osg::Group> root = new osg::Group();
> osg::ref_ptr<osg::CoordinateSystemNode> csn = new
> csn->setEllipsoidModel(new osg::EllipsoidModel());
> osg::ref_ptr<osg::Group> terrainGroup = new osg::Group();
> //osg::ref_ptr<osg::Node> terrain =
> osg::ref_ptr<osg::Node> terrain =
> osg::Vec3d m_surface;
> osg::DegreesToRadians(-83.715645f), 0.0f,
> I tried using a visitor to find the CoordSystNode in my scenegraph but when
> I checked getEllipsoidModel I got a null.
> I have used osgEarth in the past and was able to place a model on that. But
> I presently need to use vpb. If anyone can point me in the right direction,
> it would be great.
> Thank You.
> Read this topic online here:
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users