Marching cube

i have put together a marching cube algorithm form tutorials i have found on the internet and converted it to jme



unfortunately my understanding of the jme object hireachy is limited and the model has quite a slow load time



if anyone can give me tips on how i can optimise my code, please reply.



the code is at:http://www.jmonkeyengine.com/jmeforum/index.php?topic=7334.0

:-o It seems you fill your complete Object with this cubes, am I right?



I short read about marching, and so it is wanted. But for the Speed you shouldn't initialize the Cubes inside!



Perhaps its also bettter to use SharedMeshs



and set the TextureState better gloabal for the ParentNote instead of setting it to every Cube

the algorithm creates an empty node (if the polygonise function returns something) and adds up to 5 triangles based on the corner fill data i used trimesh

as it means i can give the points absolute position. The texture state is so each location can be given a unique texture



the goal of this project is to make something that will work like a terrainblock (and hopefully load and run as quickly) should i use a texture manager to generate the texture rather than setting a texture for each node?



can we make it work as an AreaClodMesh?


But for the Speed you shouldn't initialize the Cubes inside!


my jme knowledge is quite limited how do i do that?



does this helps you?



http://www.jmonkeyengine.com/jmeforum/index.php?topic=6700.0



in this case, you can only set one Texture on the Object.

But the surface is calculated dynamicly, perhabs you can associate this calculation for sorting your Boxes

I have ported some marching cubes C code I found online, it generates the isosurface into a single mesh, normals are created using duenez normal generator lib. If you want I can share the code.