java 开源地图引擎,渲染从OpenStreetMap的数据的地图有一个开源的3D引擎?

Rendering a 3D-map from an Openstreetmap data can be pretty cumbersome.

But what if the requirements are less demanding than rendering any city of the world in 3D?

What if I just need to render only a certain city limited by particular boundaries? There should not be a lot of polygons to render, especially if I choose to render only those buildings and roads that are actually seen on the screen (I have heard that this technique is used in game development).

I wish to achieve something like this, but it is ok to have just simple boxes for buildings with approximate height and no textures. So, basically I just need an OSM-based road network and simple boxes representing buildings in 3D.

So, the plan could be the following:

extract OSM data into an .osm file;

add "height" data to each building in this file (manually);

render the 3D view of the map from the .osm file (requires a custom parser) with some kind of 3D engine.

Is this plan feasible? Are there any open-source 3D engines that I can use/customize to render an OSM map from an .osm file? Are there any Linux-compatible (OpenGL?) 3D engines exist that can be [possibly] customized to render an OSM map?

解决方案

Be aware that in most areas OpenStreetMap has only on lots and roads and other stuff, but not individual buildings. That was the case last time I checked, but it depends on the area you're interested in.

As far as I know there's no off-the-box way to do this, but if you just want simple things it should not be that complicated. Brief description:

1 -Extract the footprints polygon data from the osm xml file.

2 -Project into a Cartesian of your choice, for example using PROJ.4, since osm coordinates are in lat-long.

3 -Triangulate to avoid non-convex polygons.

4 -Extrude your triangulated polygon generating a quad for each boundary edge.

5 -Finally, you can insert the generated models into your favorite 3d engine for example OpenSceneGraph or render them by yourself using OpenGL.

After that, the more things you want to add like textures, modeled detail, the more it gets complicated.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值