Patrice Poly wrote: > I will go further than my previous post. > In fact I am totally lost in coordinates systems. > > Say I have a SGGeod, or a lon,lat,elev triplet. > I want to place a lamp here, so I need to > > light->setPosition(osg::Vec4d(x,y,z, 1.0)); > > What is the relation between lon,lat,elev and x,y,z ? > How is the OSG coordinates relative to the Geodetic space ? > Before I answer that, and knowing what you want to do with light sources (landing lights), I'd say that you don't care. You should attach the light source as a child of the aircraft model, or some part of it. Then the coordinates of the light source are in the local coordinate system of the model (X aft, Z up). > That would be : I have a SGGeod, and I want to set a osg::Vec4d, > and I'm at loss facing the abstraction layers. > > The same is true for pitch,roll,yaw... > > Patrice
The graphics coordinate system is earth-centric. Z goes through the north pole, X goes through the 0 meridian at the equator. To get cartesian coordinates (as used in the graphics), see SGVec3d::fromGeod. SGGeod::makeZUpFrame returns a matrix describing the position and orientation (normal to the surface of the earth) of given geodetic coordinates in the earth centric frame. You can then convert your heading - pitch - roll to a matrix and combine it with the ZUpFrame to get the orientation and position in the global earth-centric frame. Tim ------------------------------------------------------------------------------ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel