javafx 3d performance large data set

2019-07-14 04:37发布

问题:

I have a data set which compromises of the order of a million cuboids. I render it as a single node, using TriangleMesh. This seems OK, rotation is fast. But I also want to do slicing of it, so I implemented code to recalculate the faces and apply these. It works, but is a bit slow - not in calculating the faces indices, but it seems in the rendering.

Each cuboid consists of 12 triangles

I then tried it with having a separate node for each cuboid, and setting the nodes visible/invisible. Performance of this was horrible.

Any ideas? To get an idea of what I am talking about, take a look at

http://www.peclouds.com/node/1

回答1:

Do you know the FXyz library? It has several new 3D complex shapes, along with complex texturing options, to enable contour plots, for instance.

Have a look also at the Sampler, to explore all of the options.

Some of the lastest (uncommitted) developments in the library are ScatterMesh and TetrahedraMesh.

We can read data from files, with every line containing {x,y,z,f} data, and create a tetrahedron for that point (x,y,z), using only 4 triangles (4 points and 4 faces). And we set the density color according to f.

We can add every tetrahedron as a node, and have a full group of nodes, which is only valid for small number of nodes, or we could create one single mesh, as you said, by adding every new tetrahedron to this mesh. That is really fast, and I've managed to read several millions of data points.

This mesh has 1 million of tetrahedra, or 4 million of triangles:

For now we don't have a slicing algorithm. You are welcome to contribute with it.