Re: [osg-users] geographical coordination conversion

2013-07-31 Thread Tianyun Su
Hi, Shayne.
Thanks for your reply.
What i want to do is converting Lon/Lat coordinate with WGS84 coordinate system 
to X/Y coordinate with Mercator coordate system.
How can I program in OSG?

Thank you!

Cheers,
tianyun

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53862#53862





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] geographical coordination conversion

2013-04-29 Thread Shayne Tueller
The code snippet you provided maps from a geodetic coordinate system to a 
geocentric ECEF cartesian coordinate system so that the point (lat,lon,0) maps 
to the cartesian point (o,p,q) which lies on the surface of the ellipsoid.

This probably isn't what you're looking for since it sounds like you've built 
your database to cater to a cylindrical map projection.

Also in the method convertLatLongHeightToXYZ(), height is given in meters, not 
degrees...

Shayne

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53860#53860





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] geographical coordination conversion

2013-04-29 Thread tianyun . su
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 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org