I have a ModelNode placed under the map node. I need to get the screen coordinates of the node. My simplified code is below. If I do this with any map (that I have tested) with type=geocentric, the coordinates convert correctly. However, with the 'type=projected' map they do not convert to the same screen coordinates. The world coordinates are the same regardless of type, but the translation to screen coordinates is incorrect. Note that the ModelNode altitude is 0 and the AltitudeMode is ALTMODE_RELATIVE.
osgEarth::Annotation::ModelNode* modelNode = dynamic_cast<osgEarth::Annotation::ModelNode*>(node);
if (modelNode != nullptr)
// get node position and convert to screen coordinates
osgEarth::GeoPoint geoPos = modelNode->getPosition();
Re: Incorrect Translation from World to Screen Coordinates for projected map.
Call GeoPoint::toWorld() to get worldPos.
"World" coordinates correspond to the actual coordinates in the scene graph. In geocentric, they are ECEF. In projected, they are whatever map coordinates the projection uses (in this case Mercator). The function convertLatLongHeightToXYZ will only produce geocentric coordinates, and thus won't work in the projected case. That's why you shouldn't use it directly.
Actually, I left out a step. You must also transform your GeoPoint to the Map's SRS first like so: