mapping long/lat coords to jitter/OpenGL window
Hi all, I'm having trouble accurately mapping long/lat coords into a jit window.
I took a screengrab from google maps, worked out what the boundary long/lat coords were, and then imported the image as a jit.gl.texture. I'm using two [scale] objects to convert the long and lat coords to x and y positions in the window, but when I try to draw things to certain long/lat coords, they are off in the image. Am I missing a piece of logic here? Does the image/window need to be a pixel size equal to the number of geographic degrees or something?
Thanks!
hard to say without seeing a patch.
Details inside the patch show what the long/lat coords of the image are, as well as a link to where you can quickly compare positions of a dot on the map to where it should be on the planet!
you should set @ortho 2 on jit.gl.render and use @transform_reset on your gridshape for these kinds of calculations.
That's incredibly helpful, thank you Rob! The issue seems to remain though, with quite a noticeable difference between points as they occur on the google map and how they appear on the rendered map. Any other thoughts as to why that is? Coordinates seem to be in line on the y axis, though always further left on the x axis then they should be...
Update on this - problem was solved by altering the image to be perfectly square - map coords now line up very nicely!