The Example Directory

The example files serve to demonstrate various aspects of the tool kit.

In these cases all the renderings are driven by the RML parser which identifies class names from the begin tags where required and uses Java's reflection API to construct the objects.

Note: the following is assuming you have the classes directory (../classes) in your class path.

The parser can be run by the command:

java org.bouncycastle.graphics.rt.tools.Parser file where file is one of the ".rml" files in this directory. There is also a render script/bat file in the examples directory which can be used to execute the above command.

The images generated can be displayed by the Disp program, the command for this is:

java org.bouncycastle.graphics.rt.tools.Disp file where file is a ".pix" file. There is also a disp script/bat file in the examples directory which can be used to execute the above command.

There is also a application for converting ".pix" files into ".ppm" files. The command to run to do a conversion is:

java org.bouncycastle.graphics.rt.tools.PixToPPM file where file is a ".pix" file. This application will produce a file ending in the ".ppm" extension with the same base name as the ".pix" file.

How the parser locates objects it needs

When the parser is looking for a class file it searches the following packages in order, to find the class it wants:

            "",
            "org.bouncycastle.graphics.rt.objects",
            "org.bouncycastle.graphics.rt.models",
            "org.bouncycastle.graphics.rt.shaders.ct",
            "org.bouncycastle.graphics.rt.util",
            "org.bouncycastle.graphics.rt",
            "org.bouncycastle.graphics.rt.renderers"
The upshot of this is if you want to introduce your own objects and shaders, further extending the RML parser's capabilities, it is just a matter of having your class files appear somewhere in the above path, most appropriately in the "" or root package.

Example files

test.rml

The old standby test scene this time expressed in XML, also shows antialiasing.

textures1.rml

A scene with some pillars of objects with wood and marble texturing applied. The class files produced from SolidMarble.java and SolidWood.java need to be in your class path for this scene to render. They contain the shading code for the textured objects.

textures2.rml

A scene with some pillars of objects with marble texturing applied, but in this case the texturing is down using texture space only. The class file produced from SolidMarbleWrl.java need to be in your class path for this scene to render. It contains the shading code for the textured objects.

waves.rml

Another scene with textured objects, this time using a wave texture. The wave texture is provided by the WaveShader.java file so the class file produced from it must be in your class path for the RML file to be processed.

punched.rml

This scene demonstrates rolling your own object, the file PunchedSphere.java defines a sphere that has holes punched in each axis (in object space). As the object is defined local the class file must be in your class path for the RML renderer to process the file.

plane1.rml

The beginning of another old favorite. This scene demonstrates the OFF file model object, which can be used to load and describe OFF files. bottle1.geom and goblet.geom provide input to this scene. The scene also requires the class file produced by MatteTiled.java to be in your classpath.

plane2.rml

This scene demonstrates the Obj file model object, which can be used to load and describe ".obj" files. beethoven.obj, sthenge.obj, and venus.obj provide input to this scene. The scene also requires the class files produced by MatteTiled.java, SolidMarble.java, and SolidWood.java to be in your classpath.

x29.rml

Another demonstration of the OFF file loading, with vertex normals and polygon colors. The files: x29.aof, x29.geom, x29.ipc, and x29.vnm provide the modeling data for the x29 in this scene.

x29mold.rml

Another demonstration of the OFF file loading, but this time incorporating the solid object represented in the x29.geom OFF file into a CSG object. Together with a cylinder, the x29 is subtracted from a box to give a view of how an x29 mold might look. Any solid object derived from an indexed mesh can be used in this fashion.

strip.rml

Two cubes rendered using triangle strips.

crank.rml

A CSG constructed crank.

blobby.rml

A simple metaball based object.

teapot.rml

Martin Newell's teapot, described using bicubic patches.