Terrain: triangle mesh vs HeightField

I’m working on a project in which I need to create a terrain in my PhysX 3.3 (vs2013) application.

As input data I have dted file (elevation data).

Which is the better way for create a terrain in PhysX? I need to have a large terrain.

I have tried to create an HeightField but I have found that sample array dimension is limited to 255.999 value (with 260.000 I have a crash). It’s correct this observation? This means that I need multiple Heightfield for create a large terrain?

Thanks in advance

There is no limit to the number of samples, except for the maximum value supported by unsigned int. I suspect there is something not quite right in your set up code.


Hi Gordon,
I have found an error in the heightfield creation. Thanks for the reply.

Otherwise, in your opinion, in order to improve performance, wich is the better solution for rappresenting a large area? HeightField or TriangleMesh?

Heightfield should offer better performance than TriangleMesh. Another advantage is that they are more memory efficient.