javagraphics3dvrmlx3d

Plug-in display 3d-objects from VRML or X3D


I'm not sure that such plug-ins exist.. But my program displays the data that are easily convertible to VRML or X3D file, so it would be very convenient if I could display rendered by these files figures directly in the window of the program. Anyone can suggest any plugin for Java or any solution to automate this?


Solution

  • If your program generates or reads 3D mesh data (triangles) and is able to create a String object containing a well defined X3D document representing these 3D objects then the Java 3D(TM) API and the XModelImporter API might provide a solution for you.

    XModelImporter provides Java 3D importers for "Extensible 3D (X3D)" files. In this case the 'com.interactivemesh.j3d.interchange.ext3d.XModelReader' seems to be the appropriate importer, alternatively 'com.interactivemesh.j3d.interchange.ext3d.XModelLoader'.

    The XModelReader imports X3D files by accepting different sources like 'java.io.File' and 'java.net.URL' for external data, but also 'java.io.Reader' which should be applicable for internal stored data, too.

    Following not tested scenario might work:

    Java 3D https://java3d.java.net/binary-builds.html

    XModelReader http://www.java.net/node/706300

    I'm not aware of any "currently supported" ready to go VRML or X3D players for Swing or JavaFX. Instead of converting meshes to and back from VRML or X3D you might consider choosing one of the 3D APIs for the Java platform and convert your data directly into the related format.

    August