Quote:
Originally Posted by alobar72
Hi all,
I am totally New to OpenGL... Saw some of the Videos, Read some Blogs and so but i still can't get I real start for what I'm planning to do.
So a little kickstart on how to approach this would be great.
I want to basically draw a 2d map using parts of openstreetmap data.
But I don't now how to get started. How I should setup the corrdinate systems and so on.
I know this is a bit vague... Maybe someone can help anyway.
Thanks in advance.
|
Hoo boy. OpenGL is a big subject, and so is mapping.
Most people use the map kit that's included in iOS rather than trying to roll their own mapping system. You have a big, big job ahead of you trying to write your own mapping system.
First, mapping.
Mapping uses lat/long coordinates, which describe positions on a spherical object (the earth.)
In order to plot a lat/long onto a 2D surface, you have to use some projection.
Mercator projection is the most commonly used, but by no means the only option, and not necessarily the best. You need to do a bunch of math on lat-longs in order to project them from spherical coordinates to 2D coordinates. See the link I posted to get you started.
You'll then need to take your open street maps data and render it into OpenGL, probably using an orthographic (non-perspective) projection.
I used the OpenGL Superbible when I was first learning OpenGL. That was on the Mac, not iOS. The OpenGL Superbible is about 1200 pages long, and WAY, WAAAAAAYYYY more then I can cover in an online post. You might want to buy a book on Open GL ES for the iPhone. I bet there are several good ones by now.