Longitude/Latitude to screen coordinates


by computerex
Tags: coordinates, screen
JaredJames
JaredJames is offline
#37
Mar31-11, 09:52 AM
P: 3,390
Why do you need to distort it?

If you print the images onto the map, and then save that as a new temporary image (so you have a flat map with the objects on it as a picture file), you can simply wrap that directly onto the world with your engine. It will do the distortion for you.

It's not the best way to do it, but it's the easieast if you want to check the results.
shlomi
shlomi is offline
#38
Apr3-11, 01:41 AM
P: 17
as i understanding, the distortion is needed.
to show you that - i took the same 2d image like before (2d.png) and i added a non-distorted object on it (the gray one) but i left the distorted one (yellow), now, you can see those objects on the sphere (sphere1.jpg, sphere2.jpg and sphere3.jpg), the distorted (yellow) look realistic but the gray one (that have the same dimensions like the red but another location on the world) not appear realistic, if I'll convert it with the same distortion like the yellow one it'll looks fine.

Over the weekend i read a children book (of my little daughters) that explain things about geography and i found an explanation about how create maps based on sphere (see cBookMerkator.jpg) and i found the 'Mercator projection' method, i think this is what i need but i need to find the proper math formula that let me create the distortion function.
i found this article on the internet but the answers are costing money :) so i'll keep search.

[P.S. sphere1.jpg and cBookMerkator.jpg are attached on the next post]
Attached Thumbnails
2d.jpg   sphere2.jpg   sphere3.jpg  
shlomi
shlomi is offline
#39
Apr3-11, 01:42 AM
P: 17
attached sphere1.jpg and cBookMerkator.jpg for the previous post
Attached Thumbnails
sphere1.jpg   cBookMerkator.jpg  
JaredJames
JaredJames is offline
#40
Apr3-11, 08:40 AM
P: 3,390
I don't know what you're going on about. You're not reading anything I've written.

I've told you exactly what you need to do.

You do not need the above merkator technique - that is for expanding a globe and you are not doing that.

For the last time:

1. Plot your objects onto the flat 2D map (the rectangle one you want to wrap).
2. Save that as a temporary image.
3. Wrap it on the globe.
4. The engine will distort the map and the items you marked on it.

That's all there is to it.
shlomi
shlomi is offline
#41
Apr3-11, 08:59 AM
P: 17
OK.. thanks for your patient... i'll try it.


Register to reply

Related Discussions
How does one calculate the distance (or length) on the ground General Math 3
[SOLVED] Latitude Longitude -> Polar Form -> Cartesian Coordinates Calculus & Beyond Homework 1
Astronomy - Latitude and Longitude problem Biology, Chemistry & Other Homework 3
Astronomy - Latitude and Longitude Introductory Physics Homework 0
GR - longitude/latitude geodesics problem Advanced Physics Homework 9