Jump to content

Terrain geometry - ObjectTerrainGlobal


photo

Recommended Posts

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

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.

  • Like 1
Link to comment

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

  • Like 1

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

Link to comment
  • 2 weeks later...
×
×
  • Create New...