View Full Version : Convert X-Y co-ordinate value 2 latitude&longitude
04-10-2009, 02:43 AM
How to convert the XY values to lattitude and longitude?
I mean to say, i have read x-y coordinate values using glutMotionFunc();
04-10-2009, 10:43 AM
How to convert the XY values to lattitude and longitude? ... I mean to say, i have read x-y coordinate values using glutMotionFunc();
This is mostly a geographic projection question and depends on how you're rendering "the world".
What is OBJECT and WORLD space in your app? You can use your VIEWPORT settings along with inverse PROJECTION and VIEWING matrices to get back out to WORLD space (or the inverse MODELVIEW instead of inverse VIEWING to get back out to OBJECT space). Past there, you'll have to map that 3D XYZ position to lat-lon based on your own app-specific knowledge.
Hint: Also, consider how much accuracy you need in your result. I suspect you're not gonna be happy doing this math in 32-bit float...
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.