Lucie, This is how you would place your model...
osg::Matrixd position;
ellipsoid->computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadia
ns(lat),
osg::DegreesToRadians(lon), altitude, position);
transform->setMatrix(position);
where "transform" is an osg::MatrixTransform node that has your model as a
child node.
The X,Y,Z geocentric Cartesian coordinates from the lat,lon,alt can be
extracted by:
osg::Vec3d pos = position.getTrans();
Keep in mind that an altitude of zero will yield a point on the surface of
the spheroid for a given lat,lon pair. Any altitude > zero is the height
above the ellipsoid/spheroid.
Hope this helps...
-Shayne
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of lucie
lemonnier
Sent: Wednesday, September 29, 2010 3:44 AM
To: [email protected]
Subject: Re: [osg-users] convertLatLongHeightToXYZ
Hi,
I understood that the XYZ are in Earth Center Earth Fixed coordinates.
So is it normal that X,Y are calculated based on height?
In fact, I put a latitude, longitude and height on a model, I use
osg::EllipsoidModel::convertLatLongHeightToXYZ to obtain the position x,y,z
and I transform my point with the MatrixTransforms applied on the terrain
model and I place my model with the transformed point.
Is it the step to be followed?
Thank you!
Cheers,
lucie
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32170#32170
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

