Getting screen (x,y) from lat/lon #2496
-
Hi |
Beta Was this translation helpful? Give feedback.
Answered by
gwaldron
Apr 16, 2024
Replies: 2 comments
-
Excuse any typos. GeoPoint map_coords;
...
// convert your map coordinates to world coords:
osg::Vec3d world;
map_coords.toWorld(world);
...
// convert world coords to screen coords. For this you need an osg::Camera.
auto V = camera->getViewMatrix();
auto P = camera->getProjectionMatrix();
auto W = camera->getViewport()->computeWindowMatrix();
auto screen_coords = world * (V * P * W); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gwaldron
-
Cool Thx! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Excuse any typos.