michal Posted February 6, 2021 Share Posted February 6, 2021 Hello, I just want to ask if anyone knows a straightforward approach how to get to the terrain geometry of LOD0 in ObjectTerrainGlobal. Thanks for any help. Michal R. Link to comment
christian.wolf2 Posted February 7, 2021 Share Posted February 7, 2021 Hi michal, fetching complete terrain data for ObjectTerrainGlobal is not very easy because of internal layouf for this object. I would suggest you can have a look at this discussion: You can use fetchTopologyData() as a first entry point but you can't be sure that you will receive the height for LOD 0. Maybe you will have better luck by using the texture data from the input and calculate the mesh by yourself. 1 Link to comment
silent Posted February 8, 2021 Share Posted February 8, 2021 In attachment you can find code that can generate mesh for the OjbectTerrainGlobal (for old API from 2.9 SDK). But triangles of the terrain and generated mesh would not match since there is no way to get the original triangles position and orientation from the GPU (due to the tessellation). Attached code exposes create_mesh_terrain console command that you need to execute in the loaded world with terrain. This is very naive approach (it doesn't handle too dense heights and terrains that can be larger than 16x16km). It works for the cases when terrain is less than 10x10 km. In order to maintain meshes precision you will need to split the terrain in to the grid and export multiple files. Thanks! AppSystemLogic.cpp 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
michal Posted February 19, 2021 Author Share Posted February 19, 2021 thank you for the sample Link to comment
Recommended Posts