# How should a 3D map be stored?

I have an array of 3d vertices, Vertex3D[][] ground; so for each element in the array, I have an array of three 3D vertices, a triangle.

But this means I cannot implement a quad tree, and I cannot render polygons far away from the player with less accuracy, this also means I cannot have caves because one point on the map can only have one height (y) value. How are 3D maps stored (as in what data structure) to allow further polygons to be larger and close ones to be smaller as well as having different levels (height) at the same (x,z) coord?

• Do you know anything about the concept of triangle mesh? – Alexandre Vaillancourt Jun 1 at 11:56
• There are actually a lot of terrain engines which can't do caves. If they have an overhang, it's actually a 3d entity. A cave is actually a portal to an indoor area. – Philipp Jun 1 at 18:13