Jump to content

Drawing map polygons with holes


photo

Recommended Posts

Hi!

I've stumbled across a specific problem using S-57 maps. We have succesfully imported some yandex maps into unigine, using GeoJSON and raster maps provided with yandex. Some polygons on the S-57 maps (areas) have holes in them. I there any kind of a solution for drawing meshes with holes in Unigine? Or some kind of a workaround?

In example, something like this?

Thanks in advance!

gosuslugi4.png

Link to comment

To be more precise, we have vertex coordinates of a non-convex polygon, and coordinates of vertices of a hole (holes). How to draw such a polygon in unigine (assuming that the polygon is flat, consider all z coordinates are equal to 0).

Edited by marfin.sergey
Link to comment

Hello Sergey,

i'm sorry but your final purpose is a little bit unclear for me.

If you want to use your non-convex polygon as a mask for terrain you may want to rasterize it using GlobalMapper. After that, you can add this file as a landcover source in Landscape Tool.

If you want to use this vector shape for height modification you also need to rasterize it and after that, there could be two possible ways:

  • use this file for source modification (just change the original height map in the desired area and generate terrain)
  • use this mask as an input for Houdini digital asset, but this requires Houdini Licence. HDA can modify original terrain.

There's also height brush for TerrainGlobal object, you can try it for manual modifications.

Please, let me know if I misunderstood you.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hmmm. No, I guess you misunderstood me. Can I find a way to visualize a polygon (I guess, using a mesh), with holes?

I was able to parse a GeoJSON file, there are polygons that are described as several arrays of points - first, there is an array with a non-convex polygon vertexes, described as points with x,y,z coordinates, then there are a couple arrays with other polygons, also with coordinates x,y,z, which are the holes in the first polygon.

I think it is better to look at the first screenshot.

I thought it would be better to write in English, maybe it will help someone who doesn't understand russian. But if it is easier, I can write in russian.

So far I've succeded with drawing point-type objects on the map (currently it exists in two variants - as a terrain and as a mesh, as we tried both approaches), using billboards, but I have to figure how to draw polygons(the main problem are the holes) as well as lines.

 

 

polygons.png

 

 

 

 

Edited by marfin.sergey
Link to comment

You will have to tessellate the polygon with holes into a triangle-based mesh so it can be rendered as Unigine static/dynamic mesh object. One approach might be to use OpenGL GLU tesselator.

Link to comment
×
×
  • Create New...