marfin.sergey Posted April 3, 2018 Posted April 3, 2018 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!
marfin.sergey Posted April 3, 2018 Author Posted April 3, 2018 (edited) 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 April 3, 2018 by marfin.sergey
morbid Posted April 4, 2018 Posted April 4, 2018 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
marfin.sergey Posted April 4, 2018 Author Posted April 4, 2018 (edited) 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. Edited April 5, 2018 by marfin.sergey
ulf.schroeter Posted April 5, 2018 Posted April 5, 2018 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.
ulf.schroeter Posted April 5, 2018 Posted April 5, 2018 Also have a look at http://www.cs.cmu.edu/~quake/triangle.html 1
Recommended Posts