[osg-users] Unable to place model on vpb terrain. How To ?
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Shayne.Tueller at hill.af.mil
Fri Apr 8 16:11:45 PDT 2011
You have to use the osgSim class to achieve your objective. In
particular, use the method
where X,Y,Z is the geocentric coordinates (earth centered) calculated
from a given lat,lon,alt.
The method to calculate X,Y,Z from a given lat,lon,alt is in the
EllipsoidModel class. You can extract the height on terrain from the
above HAT calculation to place your models on the terrain surface.
The reason why you want to use the osgSim class is that it accounts for
VPB pagedLOD databases when determining HAT/HOT and LOS calculations.
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Sanat
Sent: Friday, April 08, 2011 12:10 PM
To: osg-users at lists.openscenegraph.org
Subject: [osg-users] Unable to place model on vpb terrain. How To ?
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
osg::ref_ptr<osg::Group> terrainGroup = new osg::Group();
//osg::ref_ptr<osg::Node> terrain =
osg::ref_ptr<osg::Node> terrain =
s(42.291966f), 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.
Read this topic online here:
osg-users mailing list
osg-users at lists.openscenegraph.org
More information about the osg-users