Transvoxel terrain

So I have been doing some digging around for a Transvoxel terrain implementation for JME3. I see that in the past some people have built them, but tracking down working sources or anything up-to-date has been a challenge. I was wondering if anyone knows of a current, working implementation? I looked at building my own implementation, but I do not understand the math behind the mesh calculations well enough.

It would be awesome if we had an implementation native to JME3, but I know that would be a large task to undertake.

Hmmm… never heard it called “transvoxel” before. If you search for “isosurface” and/or “marching cubes” you will probably also get results.

For example:

Code here:

Some old videos here:

I also used it to do more traditional terrain in this ‘back-burnered’ project (but it’s not open source):

Thank you @pspeed, I have never heard of IsoSurface before :laughing: Transvoxel is just an improved version of MarchingCubes in a way. I will look at your demo and see if it is what I need!

Thanks again!

@pspeed I have been playing with your IsoSurface project, great job on it. It is too bad there is not a version of this integrated into JME3. I am dissecting it, but it is a large complicated system (As I would expect).

You need like 2 classes from that project. The mesh generator and the density field. The rest of it isn’t necessary to make an isosurface.

That is true, if you are only trying to use the mesh. But as for a fully functional terrain, there are many pieces that are needed, and as far as I can tell, it does not have bullet support (I need to look into it more though). I am also looking to modify it as to support runtime editing.

You mean like this? Voxel brushes are pretty cool, but they’re just very well versed mathematical functions on shape drawing. No need to recreate the wheel for that.

It’s a lot of fun to play with. I spent quite a lot of time playing around with it myself. The rabbit hole goes pretty deep on this subject.

I also published a LOD system for it. It does a great job of being able to really throw the view distance out far.


Wow that looks awesome! Good job. Would you be willing to provide links to the code for those @jayfella?


The LOD code is here.

As for brushes, voxel sniper has an assortment, but if you think about it, meshes are pretty much a dataset in themselves, so for complex shapes like a teddy bear or whatever, make a mesh in blender and use the vertex positions. If you want to cheat and make the inside hollow, shrink the mesh iteratively. It’s far quicker than crazy calculations figuring out areas.

1 Like