Isosurface rendering


#1

This is an implementation of the marching tetrahedrons algorithm from http://paulbourke.net/geometry/polygonise/#tetra mostly copied from http://michelanders.blogspot.de/2012/02/marching-tetrahedrons-in-python.html for Panda3D.
Its not very useful yet (slow and twosided rendering is needed) but you can play with it.

See https://bitbucket.org/janbrohl/isosurfacesforp3d for sourcecode.
Pull requests are very welcome :wink:


#2

Hey, looks very interesting.

But Iโ€™m not sure whats going on, could you explain usage?
Can this be used for metaballs?


#3

It is not so well documented (not at all yet) but yes Of course it can be used for metaballs. I am working on making it clearer how to use the lib.

In the current revision you would need to replace line 207 with your metaball-function and set ?min and ?max accordingly in the following lines.
You can also experiment with isolevel.


#4

Now the example uses Metaballs. See new revision.


#5

Yeah, could use some documentation (just comments would be enough).

I still donโ€™t have much idea on whats going on, or how to move the individual metaball around.

BTW, no normals?


#6

I now added some comments so hopefully the code is at least a bit more understandeable (still far from perfect, i know)
Repository

There are no normals even though it wouldnt be hard to generate them if all triangles were facing the right direction (implied by vertex ordering) which is not done yet.
Meshdrawer doesnt seem to support normals anyway so for supporting normals the (much) more verbose way for gemoetry-generation must be used which wouldnt make the example more readable.