Best way to tackle tiers of terrain and display as a cube

I have an different use for 3d than games. I am trying to visualize terrain that has changed over time - e.g. land as it was 1 million years ago, 500k years ago and 10 years ago. I have what is basically a heightmap for each “age” and associated color data for each vertex, but I have several different display needs:


  1. Display one or more of the terrains at the same time. Since it is a sediment model, the younger terrains will always have a greater y-value than older terrain, so I am not worried about overlap.
  2. Display a 3d cube that can be sliced along any plane (XY, XZ, YZ) and show an interpolated view of that surface. I don’t know if that is clear, so an analogy might help. Assume I have a multicolored block of clay. I want to be able to chop it in half and look at what the exposed walls of the pieces look like.
  3. A combination of those two. Basically, starting with a scene that has all of the terrains in a stack with empty space between (#1), I want to be able to slice them and see what it looks like as in #2.



    So, I am trying to figure out the best way to accomplish all of this. I have taken a look at the terrain capabilities and it looks like a perfect fit for #1 except that I need multiple layers and the ability to slice into it to accomplish #3. I have also looked at directly building the meshes for each layer, but that looks like the sliced-views are still difficult and it is more work to build the meshes than using the capabilities built into the terrain tools.



    I was wondering if someone had tackled this, or a similar problem before.

Since you would only raise the fill rate by actually having the single layers there all the time you should probably rather have a class that creates the view from the current selection. Meaning that you have only one actual heightmap that is equivalent to the currently displayed upper layer and then you have to paint the visible “clay” layers onto the sides. The latter is probably the biggest challenge as you will have to use different texture projection algorithms… I think there was something added for the grid terrain though, you will probably have to extend a shader for that part.

For #1, you need a way to add some thickness to the terrain because right now its just composed of a really flat surface.

For #2/#3 you can use Camera.setClipPlane() which allows you to set a plane along which all geometry is clipped. You can also do it in a shader