Hi,
I use osgdem to create an IVE model with mercator projection and can load the 
model in my OSG program.  I want to realize such funciton:
(1) input the WGS84 coordinate (lon, lat) of target point
(2) calculate the elevation (z) of the point from the terrain file
(3) draw a graphic object at the point (lon, lat, z) 
The problem is how to convert the WGS84 coordinate of inputted point to 
mercator projection which is used in my OSG program.

I have used the folllowing method:

osg::ref_ptr<osg::CoordinateSystemNode> csn=new osg::CoordinateSystemNode;
csn->setEllipsoidModel(new osg::EllipsoidModel);
csn->addChild(terrain);//"terrain" is IVE model with mercator projection
double o,p,q;
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(osg::DegreesToRadians(80.0),osg::DegreesToRadians(115.0),osg::DegreesToRadians(0.0),o,p,q);
The convert value (o,p,q) is not correct.
How can I realize the function?

Thank you!

Cheers,
tianyun
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to