0
$\begingroup$

I have OSM world data (essentially I processed the XML data into JSON containing arrays of objects (streets, buildings etc.) that each are represented by an array of lat/lon coordinates). Some of these are lines (roads etc.), others are areas that have to be filled (1st and last point close the area).

Anyhow, I would like to achieve an image similiar to google maps or mapbox but much simpler as I do not require city name labels or anything of the sort. For now all I really need is roads.

I need this for a game I am making so the method itself must not be the most elegant one as I probably wont be doing this on the fly but rather prerendering the world to then send the images prerendered to the players.

My question is merely, where the heck do I start? I have no idea how the rendering of bitmaps is done (or whatever other format is best.)

I know C# and NodeJS and am not afraid of learning new frameworks or technologies.

$\endgroup$
2
  • $\begingroup$ There are several open-source libraries for rendering OSM data. Couldn't you use one of those? $\endgroup$
    – Dan Hulme
    Dec 13, 2017 at 10:12
  • $\begingroup$ Well I found a few of those but they all dont seem customizable enough. Like what if I have my own data and e.g. would want to render a "hut" on the road side. The way I see it I have to either use the existing renderers and then insert the hut in the front end engine I am using, or render everything completely myself which is what I was going for. $\endgroup$ Dec 13, 2017 at 15:26

1 Answer 1

1
$\begingroup$

If you have the prerendered images, you can "simply" render them onto a grid of quads. This is done with texturing, i.e. you upload the image to your GPU as a texture and apply texturecoordinates to quads, such that when you render the quads, the textures are applied correctly to their surfaces.

You will however need to learn OpenGL (preferrably with GLSL), Direct3D with HLSL or even Vulkan, all of which will take some time. Depneding on where your goals lie, you may be better of going with a preexisting rendering engine and just learning like Unity or Unreal.

If you do want to learn one of the mentioned Graphics APIs, there are numerous tutorials on the web. For OpenGL I can recommend the youtube tutorials by ThinMatrix, for the other two APIs you'd need to ask someone else. Furthermore, there are splendid books online as well as offline. If you have some money to burn, the basics of rendering are covered in Real-Time Rendering and Mathematics for 3d Game Programming and Computer Graphics. In regards to OpenGL, there are the Online Tutorials of Learn OpenGL, as well as offline books in pdf and epub version.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.