CyberVRML97 for Java

Introduction

CyberVRML97 for Java is a development package for VRML97/2.0 and Java3D programmers. Using the package, you can easily read and write the VRML files, set and get the scene graph information, draw the geometries, run the behaviors easily. Please check the project site on SourceForge.net to get the source codes and documents.

Setup

To use the package, copy the package into your JDK/JRE library directory or add the package into your CLASSPATH environmental variable. For example, set CLASSPATH=.\;c:\src\java\cv97r???.jar

Class Overview

SceneGraph Class

!SceneGraph class is a top class of the package. The important methods is below.  
public class SceneGraph { 
////////////////////////////////////////////////////////  
// Constructor 
//////////////////////////////////////////////////////// 
Scene Graph();  

//////////////////////////////////////////////////////// 
// File input / output 
//////////////////////////////////////////////////////// 
void load(char filename); 
void add(char filename); 
void save(char filename); 

//////////////////////////////////////////////////////// 
// Add a node 
//////////////////////////////////////////////////////// 
void addNode(Node node) 

//////////////////////////////////////////////////////// 
// Get a first list node 
//////////////////////////////////////////////////////// 
Node getNodes() 

//////////////////////////////////////////////////////// 
// Get a first specific node in scene graph 
//////////////////////////////////////////////////////// 
AnchorNode getAnchorNodes() 
AppearanceNode getAppearanceNodes() 
AudioClipNode getAudioClipNodes() 
BackgroundNode getBackgroundNodes() 
BillboardNode getBillboardNodes() 
Box getBoxeNodes() 
CollisionNode getCollisionNodes() 
ColorNode getColorNodes() 
ColorinterpolatorNode getColorinterpolatorNodes() 
ConeNode getConeNodeNodes() 
CoordinateNode getCoordinateNodes() 
CoordinateinterpolatorNode getCoordinateinterpolatorNodes() 
CylinderNode getCylinderNodes() 
CylinderSensorNode getCylinderSensorNodes() 
DirectionalLightNode getDirectionalLightNodes() 
ElevationGridNode getElevationGridNodes() 
ExtrusionNode getExtrusionNodes() 
FogNode getFogNodes() 
FontStyleNode getFontStyleNodes() 
GroupNode getGroupNodes() 
ImagetextureNode getImagetextureNodes() 
IndexedFaceSetNode getIndexedFaceSetNodes() 
IndexedLineSetNode getIndexedLineSetNodes() 
Inline getInlineNodes() 
LODNode getLODNodes() 
MaterialNode getMaterialNodes() 
MovieTextureNode getMovieTextureNodes() 
NavigationInfoNode getNavigationInfoNodes() 
NormalNode getNormalNodes() 
NormalinterpolatorNode getNormalinterpolatorNodes() 
OrientationinterpolatorNode getOrientationinterpolatorNodes() 
PixelTextureNode getPixelTextureNodes() 
PlaneSensorNode getPlaneSensorNodes() 
PointLightNode getPointLightNodes() 
PointSetNode getPointSetNodes() 
PositioninterpolatorNode getPositioninterpolatorNodes() 
ProximitySensorNode getProximitySensorNodes() 
ScalarinterpolatorNode getScalarinterpolatorNodes() 
ScriptNode getScriptNodes() 
ShapeNode getShapeNodes() 
SoundNode getSoundNodes() 
SphereNode getSphereNodes() 
SphereSensorNode getSphereSensorNodes() 
SpotLightNode getSpotLightNodes() 
SwitchNode getSwitchNodes() 
TextNode getTextNodes() 
TextureCoordinateNode getTextureCoordinateNodes() 
TextureTransformNode getTextureTransformNodes() 
TimeSensorNode getTimeSensorNodes() 
TouchSensorNode getTouchSensorNodes() 
TransformNode getTransformNodes() 
ViewpointNode getViewpointNodes() 
VisibilitySensorNode getVisibilitySensorNodes() 
WorldInfoNode getWorldInfoNodes()  

//////////////////////////////////////////////////////// 
// Find a first specific node in scene graph 
//////////////////////////////////////////////////////// 
AnchorNode findAnchorNode(); 
AppearanceNode findAppearanceNode(); 
AudioClipNode findAudioClipNode(); 
BackgroundNode findBackgroundNode(); 
BillboardNode findBillboardNode(); 
BoxNode findBoxeNode(); 
CollisionNode findCollisionNode(); 
ColorNode findColorNode(); 
ColorInterpolatorNode findColorInterpolatorNode(); 
ConeNode findConeNode(); 
CoordinateNode findCoordinateNode(); 
CoordinateInterpolatorNode findCoordinateInterpolatorNode(); 
CylinderNode findCylinderNode(); 
CylinderSensorNode findCylinderSensorNode(); 
DirectionalLightNode findDirectionalLightNode(); 
ElevationGridNode findElevationGridNode(); 
ExtrusionNode findExtrusionNode(); 
FogNode findFogNode(); 
FontStyleNode findFontStyleNode(); 
GroupNode findGroupNode(); 
ImageTextureNode findImageTextureNode(); 
IndexedFaceSetNode findIndexedFaceSetNode(); 
IndexedLineSetNode findIndexedLineSetNode(); 
InlineNode findInlineNode(); 
LodNode findLODNode(); 
MaterialNode findMaterialNode(); 
MovieTextureNode findMovieTextureNode(); 
NavigationInfoNode findNavigationInfoNode(); 
NormalNode findNormalNode(); 
NormalInterpolatorNode findNormalInterpolatorNode(); 
OrientationInterpolatorNode findOrientationInterpolatorNode(); 
PixelTextureNode findPixelTextureNode(); 
PlaneSensorNode findPlaneSensorNode(); 
PointLightNode findPointLightNode(); 
PointSetNode findPointSetNode(); 
PositionInterpolatorNode findPositionInterpolatorNode(); 
ProximitySensorNode findProximitySensorNode(); 
ScalarInterpolatorNode findScalarInterpolatorNode(); 
ScriptNode findScriptNode(); 
ShapeNode findShapeNode(); 
SoundNode findSoundNode(); 
SphereNode findSphereNode(); 
SphereSensorNode findSphereSensorNode(); 
SpotLightNode findSpotLightNode(); 
SwitchNode findSwitchNode(); 
TextNode findTextNode(); 
TextureCoordinateNode findTextureCoordinateNode(); 
TextureTransformNode findTextureTransformNode(); 
TimeSensorNode findTimeSensorNode(); 
TouchSensorNode findTouchSensorNode(); 
TransformNode findTransformNode(); 
ViewpointNode findViewpointNode(); 
VisibilitySensorNode findVisibilitySensorNode(); 
WorldInfoNode findWorldInfoNode();  

//////////////////////////////////////////////////////// 
// Update all node and route infomations 
//////////////////////////////////////////////////////// 
void update(); 
void startSimulation(); 
void stopSimulation(); 
}

Use load() to load a scene graph information from a geometry file of VRML97, Autodesk 3DS, Wavefront OBJ or SENSE8 NFF, and use save() to save a current scene graph information into a VRML97 file. The sample is below.

    Scene Graph sceneGraph = new Scene Graph();
    sceneGraph.load("world.wrl"); 
        ..........
    sceneGraph.save("newworld.wrl");
PROTO is supported using a preprocessor, but the preprocessor is inactive by default.If you want to use the preprocessor, use setOption() in Scene Graph class with USE_PREPROCESSOR before loading. For example,
Scene Graph sg = new Scene Graph(); 
sg.setOption(SceneGraph.USE_PREPROCESSOR); 
sg.load(.........);
After the loading , the Scene Graph instance has node information using instances of Node class. The Node class is a super class of all VRML node classes. There are two ways to get the node instances. The first way is to use getNodes() of Scene Graph class with next() and getChildNodes() of Node class. For example, if you want to get all viewpoint nodes in the scene graph .....
    public void getViewpointInfomation(Node *node)
    {
        if (node.isViewpointNode()) {
            ViewpointNode view = (Viewpoint)node;
            // Get a viewpoint information
            ..........
        }

        for (Node cnode=node.getChildNodes(); cnode != null; cnode=cnode.next())
            GetViewpointInfomation(cnode);
    }

    public void loadSceneGraph(String filename) 
    {
        ..........

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load(filename); 
        for (Node node=sceneGraph.getNodes(); node != null; node=node.next())
            getViewpointInfomation(node);

        ..........
    }
The second way is to use getNodes() of Scene Graph with only nextTraversal() of Node class. The way is handier than the first one. For example, if you want to get all viewpoint nodes in the scene graph .....
    public void loadSceneGraph(String filename) 
    {
        ..........

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load(filename); 
        for (Node node=sceneGraph.getNodes(); node != null; node=node.nextTraversal())
            if (node.isViewpoint()) {
                ViewpointNode view = (ViewpointNode)node;
                // Get a viewpoint information
                ..........
            }
        }
        ..........
    }
If you want to get only nodes of the same type, use find*Node() instead of getNodes(). For example, if you want to get only viewpoint nodes in the scene graph .....
    public void loadSceneGraph(String filename)
    {
        ..........

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load(filename); 
        for (ViewpointNode view=sceneGraph->findViewpointNode();
                          view; view=(ViewpointNode)view->nextTraversalSameType()) {
            // Get a viewpoint information
            ..........
        }
        ..........
    }
There are two way to execute behaviors in the scene graph. If you want to execute the behaviors as background tasks (threads), you should use startSimulation() and stopSimulation(). Otherwise, If you want to execute the behavios when you want, you should use update(). The update() execute the behaviors at once For examples, when you want to execute as backgrond tasks .............
      void main() 
    { 
        .......... 

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load("world.wrl"); 
        sceneGraph.startSimulation(); 

        .......... 
    } 
Java is supported as a script language in Script node, but processEvents() and the eventsProcessed() are not supported in the current version.

Node Class

Althought you may not create instances of Node class directly, but it is a important class because the class is a super class of all VRML node classes. Node class is a sub class of LinkedListNode class. Thus the all nodes are managed as the list structure, and a node instance can have other node instances as the child. The important methods are below.
public class Node { 
//////////////////////////////////////////////////////// 
// Get a next node of list 
////////////////////////////////////////////////////////  

public Node next() 
public Node nextSameType() 
public Node nextTraversal() 
public Node nextTraversalSameType() 

//////////////////////////////////////////////////////// 
// Add a child node 
//////////////////////////////////////////////////////// 

void addChildNode(Node node) 

//////////////////////////////////////////////////////// 
// Remove the node 
//////////////////////////////////////////////////////// 
void remove () 

//////////////////////////////////////////////////////// 
// Get a first child node 
////////////////////////////////////////////////////////  

public Node getChildNodes() 

//////////////////////////////////////////////////////// 
// Get a first specific child node 
////////////////////////////////////////////////////////  

AnchorNode getAnchorNodes() 
AppearanceNode getAppearanceNodes() 
AudioClipNode getAudioClipNodes() 
BackgroundNode getBackgroundNodes() 
BillboardNode getBillboardNodes() 
BoxNode getBoxeNodes() 
CollisionNode getCollisionNodes() 
ColorNode getColorNodes() 
ColorbooleanerpolatorNode getColorbooleanerpolatorNodes() 
ConeNode getConeNodes() 
CoordinateNode getCoordinateNodes() 
CoordinatebooleanerpolatorNode getCoordinatebooleanerpolatorNodes() 
CylinderNode getCylinderNodes() 
CylinderSensorNode getCylinderSensorNodes() 
DirectionalLightNode getDirectionalLightNodes() 
ElevationGridNode getElevationGridNodes() 
ExtrusionNode getExtrusionNodes() 
FogNode getFogNodes() 
FontStyleNode getFontStyleNodes() 
GroupNode getGroupNodes() 
ImageTextureNode getImageTextureNodes() 
IndexedFaceSetNode getIndexedFaceSetNodes() 
IndexedLineSetNode getIndexedLineSetNodes() 
InlineNode getInlineNodes() 
LODNode getLODNodes() 
MaterialNode getMaterialNodes() 
MovieTextureNode getMovieTextureNodes() 
NavigationInfoNode getNavigationInfoNodes() 
NormalNode getNormalNodes() 
NormalbooleanerpolatorNode getNormalbooleanerpolatorNodes() 
OrientationbooleanerpolatorNode getOrientationbooleanerpolatorNodes() 
PixelTextureNode getPixelTextureNodes() 
PlaneSensorNode getPlaneSensorNodes() 
PobooleanLightNode getPobooleanLightNodes() 
PobooleanSetNode getPobooleanSetNodes() 
PositionbooleanerpolatorNode getPositionbooleanerpolatorNodes() 
ProximitySensorNode getProximitySensorNodes() 
ScalarbooleanerpolatorNode getScalarbooleanerpolatorNodes() 
ScriptNode getScriptNodes() 
ShapeNode getShapeNodes() 
SoundNode getSoundNodes() 
SphereNode getSphereNodes() 
SphereSensorNode getSphereSensorNodes() 
SpotLightNode getSpotLightNodes() 
SwitchNode getSwitchNodes() 
TextNode getTextNodes() 
TextureCoordinateNode getTextureCoordinateNodes() 
TextureTransformNode getTextureTransformNodes() 
TimeSensorNode getTimeSensorNodes() 
TouchSensorNode getTouchSensorNodes() 
TransformNode getTransformNodes() 
ViewpointNode getViewpointNodes() 
VisibilitySensorNode getVisibilitySensorNodes() 
WorldInfoNode getWorldInfoNodes()  

//////////////////////////////////////////////////////// 
// Confirm the node type 
//////////////////////////////////////////////////////// 
boolean isAnchorNode() 
boolean isAppearanceNode() 
boolean isAudioClipNode() 
boolean isBackgroundNode() 
boolean isBillboardNode() 
boolean isBoxNode() 
boolean isCollisionNode() 
boolean isColorNode() 
boolean isColorbooleanerpolatorNode() 
boolean isConeNode() 
boolean isCoordinateNode() 
boolean isCoordinatebooleanerpolatorNode() 
boolean isCylinderNode() 
boolean isCylinderSensorNode() 
boolean isDirectionalLightNode() 
boolean isElevationGridNode() 
boolean isExtrusionNode() 
boolean isFogNode() 
boolean isFontStyleNode() 
boolean isGroupNode() 
boolean isImageTextureNode() 
boolean isIndexedFaceSetNode() 
boolean isIndexedLineSetNode() 
boolean isInlineNode() 
boolean isLODNode() 
boolean isMaterialNode() 
boolean isMovieTextureNode() 
boolean isNavigationInfoNode() 
boolean isNormalNode() 
boolean isNormalbooleanerpolatorNode() 
boolean isOrientationbooleanerpolatorNode() 
boolean isPixelTextureNode() 
boolean isPlaneSensorNode() 
boolean isPobooleanLightNode() 
boolean isPobooleanSetNode() 
boolean isPositionbooleanerpolatorNode() 
boolean isProximitySensorNode() 
boolean isScalarbooleanerpolatorNode() 
boolean isScriptNode() 
boolean isShapeNode() 
boolean isSoundNode() 
boolean isSphereNode() 
boolean isSphereSensorNode() 
boolean isSpotLightNode() 
boolean isSwitchNode() 
boolean isTextNode() 
boolean isTextureCoordinateNode() 
boolean isTextureTransformNode() 
boolean isTimeSensorNode() 
boolean isTouchSensorNode() 
boolean isTransformNode() 
boolean isViewpobooleanNode() 
boolean isVisibilitySensorNode() 
boolean isWorldInfoNode()  

//////////////////////////////////////////////////////// 
// Get fields 
//////////////////////////////////////////////////////// 
public final Field getEventIn(String fieldName) 
public final ConstField getEventOut(String fieldName) 
public final Field getExposedField(String fieldName)  

//////////////////////////////////////////////////////// 
// Update internal infomations 
//////////////////////////////////////////////////////// 
abstract public void update()  

} 
Use next() when you want to get a next node in the current hierarchy, The method returns a next node in the list, or returns null if the next node does not exist in the current hierarchy. For example .........
    void main() 
    { 
        .......... 

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load("world.wrl"); 

        for (Node node=sceneGraph.getNodes(); node; node=node.next()) { 
            .......... 
        } 

        .......... 
    } 
Use nextSameType() when you want to get a next node which is the same type in the current hierarchy. For example, use the method when you want to get only viewpoint nodes. The method returns a next node, or returns null if the next node does not exist in the current hierarchy. For example .........
    void main() 
    { 
        .......... 

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load("world.wrl"); 

        for (Viewpoint view=sceneGraph.getViewpointNodes(); view; 
                                   view=(ViewpointNode)view.nextSameType()) { 
            .......... 
        } 

        .......... 
    } 
nextTraversal() is similar to next(), but the method tries to acquire a next node after returning to the parent node when the next node does not exist. Using the method, you can access the all nodes in the entire scene graph easily.
    void main() 
    { 
        .......... 

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load("world.wrl"); 

        for (Node node=sceneGraph.getNodes(); node; node=node.nextTraversal()){ 
            .......... 
        } 

        .......... 
    } 
nextTraversalSameType() is similer to nextSameType(), but the method tries to acquire a next node after returning to the parent node when the next node does not exist. Using the method, you can access the all nodes which are same type in the entire scene graph easily.
    void main() 
    { 
        .......... 

        Scene Graph sceneGraph = new Scene Graph(); 
        sceneGraph.load("world.wrl"); 

        for (Viewpoint view=sceneGraph.findViewpointNode(); view;  
                          view=(ViewpointNode)view.nextTraversalSameType()) { 
            .......... 
        } 

        .......... 

    }
If you want to get information from a node, use get*() to get a value from the single field (SF*), SFInt32 etc, or use getN*() and get*() to get values from the multi fields (MF*), MFInt32 etc. For example, Anchor class has the following methods to get the not information. About the other nodes, please confirm the class.
class AnchorNode extends GroupingNode { 
// Description 
String getDescription() 
// Parameter 
int getNParameters() 
String getParameter(int index) 
// URL 
int getNUrls() 
String getUrl(int index) 
}

SceneGraph Assembly

You can add or remove all VRML nodes into the SceneGraph dynamically. In the following code, a VRML file is loaded into the SceneGraph. Then, the fitst PointLight node is removed, a new spehere geometry is added, and the SceneGraph is saved into other VRML file.
SceneGraph sg; 
sg.load("world.wrl"); 
// Remove first PointLight node 
PointLightNode plight = sg.findPointLightNode(); 
if (plight != null) 
    plight.remove(); 

// Add a new spehere 
ShapeNode shape = new ShapeNode(); 
sg.addNode(shape); 

Appearancenode app = new AppearanceNode(); 
shape.addChildNode(app); 

MaterialNode mat = new MaterialNode(); 
mat.setDiffuseColor(1.0f, 0.0f, 0.0f); // Red 
app.addChildNode(mat); 

SphereNode sphere = new SphereNode(); 
shape.addChildNode(sphere); 
sphere.setRadius(10.0f); 

sg.save("new_world.wrl");
If you want to display the new added nodes, you have to call SceneGrpah::initialize() to rebuild the display lists of Java3D.

File Formats

The CyberVRML97 supports for loading the following geometry file formats. To load the geometry files, use SceneGraph::load method.

VRML97 (*.wrl)

The CyberVRML97 can gets all information in the specified VRML97 file.

X3D (*x3d / *.xml)

Currentlly, the CyberVRML97 supports Don Brutzman's draft XML tagsets. The CyberVRML97 can gets all tag information without the EXTERNPROTO and PROTO defines in the specified X3D file.

Autodesk 3DS (*.3ds)

The CyberVRML97 gets only the following information from the specified 3DS file, and ignore the other information. The CyberVRML97 converts from the loading information into VRML97 nodes, add the nodes into the scene graph.
Chunk ID Description
0xA010 Material Ambient Color
0xA020 Material Diffuse Color
0xA030 Material Specular Color
0xA040 Materisl Shininess
0x4100 Triangle Set
0x4110 Triangle Point Set
0x4120 Triangle Fase Set

Autodesk DXF (*dxf)

The CyberVRML97supports only the polylines and face3Ds information from the specified OBJ file, and converts from the loading information into VRML97 nodes, add the nodes into the scene graph. Wavefront OBJ (*.obj) The CyberVRML97supports only the following information from the specified OBJ file, and ignore the other information. The CyberVRML97 doesn’t read the map files and the material files. The CyberVRML97 only converts from the loading information into VRML97 nodes, add the nodes into the scene graph.
ID Description
v Vertex Position
vn Vertex Normal
f Face Index

SENSE8 NFF (*.nff)

The CyberVRML97 gets only the vertex positions and the polygon indices with the color from the specified NFF file, and ignore the other information. The CyberVRML97 converts from the loading information into VRML97 nodes, add the nodes into the scene graph.

Java3D

This package can draw shape instances with the behaviors in a current scene graph automatically into a Canvas3D of Java3D. To use the feature, you have to create a instance of vrml.j3d.SceneGraphJ3dObject class with a target Canvas3D, and set the instance as a object of a instance of Scene Graph class. For example,
public class ViewerJ3D extends Frame implements Constants { 
   private Scene Graph   mSceneGraph; 
   private SceneGraphJ3dObject mSceneGraphObject; 

   public ViewerJ3D(){ 
      super("VRML Simple Viewer"); 

         .................... 

      mSceneGraph = new SceneGraph(SceneGraph.NORMAL_GENERATION); 

      setLayout(new BorderLayout()); 
      Canvas3D c = new Canvas3D(null); 
      add("Center", c); 

      mSceneGraphObject = new SceneGraphJ3dObject(c, mSceneGraph); 
      mSceneGraph.setObject(mSceneGraphObject); 

         .................... 

      setSize(400,400); 
      show(); 
    } 

    .................... 
    .................... 

}
In the current release, only the following nodes are supported, and display the shapes with the behaviors into the Canvas3D automatically.

Anchor (*1)  
Appearance  
Background (*2)  
Billboard  
Box  
Collision (*3)  
Color  
ColorInterpolator  
Cone  
Coordinate  
CoordinateInterpolator  
Cylinder  
DirectionalLight  
ElevationGrid  
Extrusion  
Fog  
Group  
ImageTexture  
IndexedFaceSet  
IndexedLineSet  
Inline  
LOD  
 Material  
Normal  
NormalInterpolator  
OrientationInterpolator  
PixelTexture  
PointLight  
PointSet  
PositionInterpolator  
ProximitySensor  
ScalarInterpolator  
Script  
Shape  
Sphere  
SpotLight  
Switch  
Text  
TextureCoordinate  
TextureTransform  
TimeSensor  
Transform  
Viewpoint  
*1) Not support the URL field jump. 
*2) Support only the first skyColor 
*3) Not support the collision detecting. 

This package has other interfaces for Java3D, VRML97Loader and VRML97Saver. The VRMLLoader load a VRML97 file, and return the scene graph of Java3D. The following example loads a VRML97 file and get the BranchGroup of Java3D. VRML97Loader loader = new VRML97Loader(); loader.load("Sample.wrl"); BranchGroup branchGroup = loader.getBranchGroup(); The VRML97Loader in the current release converts the following VRML97 nodes into Java3D nodes.

Anchor (Group)  
Appearance (Appearance)  
Billboard (TransformGroup)  
Box (QuadArray)  
Collision (Group)  
Color  
Cone (TriangleArray)  
Coordinate  
Cylinder (TriangleArray)  
DirectionalLight (DirectionalLight)  
ElevationGrid (IndexedTriangleArray)  
Extrusion (IndexedTriangleArray)  
Fog (ExponentialFog or LinerFog)  
Group (Group)  
ImageTexture (Texture2D)  
IndexedFaceSet (IndexedTriangleArray)  
 IndexedLineSet (IndexedLineArray)  
Inline  
LOD (Switch)  
Material (Material)  
Normal  
PixelTexture (Texture2D)  
PointLight (PointLight)  
PointSet (IndexedPointArray)  
Shape (Shape3D)  
Sphere (TriangleArray)  
SpotLight (SpotLight)  
Switch (Switch)  
Text (Text3D)  
TextureCoordinate  
TextureTransform (TextureAttributes)  
Transform (Transform)  
The VRMLSaver outputs a scene graph of Java3D into a VRML97 file. The following example saves a BranchGroup of Java3D into a VRML97 file.
BranchGroup j3dBranchGroup = .......
VRML97Saver saver = new VRML97Saver();
saver.setBranchGroup(j3dBranchGroup);
saver.save(outputFileName);
The VRML97Saver in the current release converts the following Java3D nodes into the VRML97 nodes.

AmbientLight (PointLight)  
Appearance (Appearance)  
Background (Background)  
Billboard (Billboard)  
BranchGroup (Group)  
DirectionalLight (DirectionalLight)  
ExponentialFog (Fog)  
Group (Group)  
IndexedTriangleArray (IndexedFaceSet)  
IndexedQuadArray (IndexedFaceSet)  
LineArray (IndexedLiseSet)  
LineStripArray (IndexedLiseSet)  
LinearFog (Fog)  
Material (Material)  
 PointLight (PointLight)  
PointArray (PointSet)  
Shape3D (Shape)  
SpotLight (SpotLight)  
Switch (Switch)  
Text3D (Text)  
Texture2D (PixelTexture)  
TransformGroup (Transform) (*1)  
TriangleArray (IndexedFaceSet)  
TriangleFanArray (IndexedFaceSet)  
TriangleStripArray (IndexedFaceSet)  
QuadArray (IndexedFaceSet)  
View (Viewpoint)  
    *1) Not support all matrix information

X3D

Currentlly, the CyberVRML97 supports Don Brutzman's draft X3D tagsets. If you want to save a current scene graph into a XML file format, use SceneGraph::saveXML method. The simple example is below.
    Scene Graph sceneGraph = new Scene Graph(); 
    sceneGraph.load("world.x3d");  
        .......... 
    sceneGraph.saveXML("newworld.x3d"); 

License

CyberVRML97 for Java is provided "AS IS". Licenser disclaims all warranties, including but not limited to, all express or implied warranties of merchantability and fitness for a particular purpose. Everyone can use the CyberVRML97 for commerce or personal purposes free. However, If you want to distribute your software using the CyberVRML97, you have to add state that "Portions of this software is based in part on the CyberVRML97 package written by Satoshi Konno" into the program or document.
Topic revision: r4 - 2011-02-02 - SatoshiKonno
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2014 by Satoshi Konno Powerd by TWiki logoTWiki.