The algorithm for converting latitude and longitude coordinates to the world (OpenGL)

I have a set of latitude and longitude coordinates that should be displayed in the GL program I'm working on. I have information, such as the number of units per degree of latitude and longitude (I have coordinates in decimal degrees, for example, 27.1234) - for example, 15 units for longitude and 10 units for latitude. However, I had problems rendering.

This calculation gives me places that I can use for rendering, but this is not ideal. At first, I tested only with coordinates such as S026.33.01.806 E148.46.27.009, and when I switched to coordinates such as N039.52.19.030 W075.14.28.107, the rendering turned up and down and flipped horizontally.

This may be a fundamental lack of understanding of OpenGL and how it interprets the coordinates, or maybe I'm misplacing the problem. I use Python and PyOpenGL, but I assume that this algorithm is something that can be done without a specific language requirement.

EDIT: I downloaded the code, which seems to be most appropriate for http://slexy.org/view/s21LKiD9tj .

+3
source share
1 answer

Erm, the number of units of longitude is not constant? What weird conversion function are you using?

, r, , z, , x, 0, y, 90, :

x = r * cos(latitude) * cos(longitude);
y = r * cos(latitude) * sin(longitude);
z = r * sin(latitude);

. , , , .

+10

Source: https://habr.com/ru/post/1726844/


All Articles