customnode
package aims to provide classes which facilitate
to add new (custom) 3D objects to the viewer.
In addition to the classes provided by this package, you may consider to use
the helper methods of ij3d.Image3DUniverse
, which are in
particular:
addLineMesh
and addTriangleMesh
are
for displaying custom meshes, whose vertices are given in a list. (Refer to
the documentation of these methods for more detail).ImageJ3DUniverse
has the method
{@link ij3d.Image3DUniverse#addCustomMesh Image3DUniverse.addCustomMesh(CustomMesh)}.
CustomMesh
is an abstract base class, which is extended by
Point3f
, which specify
the corresponding mesh. To facilitate the mesh creation of some basic
shapes, {@link customnode.Mesh_Maker MeshMaker} offers a few static methods:
Content
:
Content content = new Content("My example Content");
content.color = new Color3f(1, 0, 0);
content.showCoordinateSystem(false);
ContentNode
is the displayed unit of a Content, the actual 3D object.
It belongs to a Content
, and gets informed by this Content
when the color, transparency, etc of the Content was updated. To enable this
mechanism, your class has to implement the abstract methods of
ContentNode
. If you are looking for an example, have a look at
{@link customnode.CustomMeshNode CustomMeshNode}.
Now, display the content:
Image3DUniverse universe = new Image3DUniverse(512, 512);
content.display(myContentNode);
universe.addContent(content);