| New Reply |
Longitude/Latitude to screen coordinates |
Share Thread | Thread Tools |
| Mar31-11, 09:36 AM | #35 |
|
|
Longitude/Latitude to screen coordinatesThe easiest way to achieve the above, is to lay a grid over your image (using the lat and lon values for x and y). You then have a database of 'what goes where' and so you would query the database for the coordinates (x and y) and what the object is (let's say it's a ball, you could then query another table to retrieve the ball picture - see normalisation if you're unfamiliar, it cuts down redundancy). You then plot them on the grid overlaid on the map. This can either be dynamically wrapped around the sphere, or easier would be to save it as an image and simply wrap it as is. |
| Mar31-11, 09:49 AM | #36 |
|
|
but after that all of the objects are draw on the big image, i need to distort the image to be like image #1 ( or maybe distort the object before i plot it on the biug image) and this is what i'm looking for: how can i know how much distortion (via transformation) i need to do for object that for instance, located on the equator of for object that located on the north? |
| Mar31-11, 09:52 AM | #37 |
|
|
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. |
| Apr3-11, 01:41 AM | #38 |
|
|
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] |
| Apr3-11, 01:42 AM | #39 |
|
|
attached sphere1.jpg and cBookMerkator.jpg for the previous post
|
| Apr3-11, 08:40 AM | #40 |
|
|
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. |
| Apr3-11, 08:59 AM | #41 |
|
|
OK.. thanks for your patient... i'll try it.
|
| New Reply |
| Thread Tools | |
Similar Threads for: Longitude/Latitude to screen coordinates
|
||||
| Thread | Forum | Replies | ||
| 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 | ||