Embedding BS Contact J


Embedding BS Contact J on an HTML page requires minimally the following lines of HTML code:

<applet archive="bscontactj.jar" code="com/blaxxun/bx3d/blaxxun3d.class" name="browser" width="320" height="240"> 
<param name=scene value="content.wrl"> 
Sorry, your browser doesn't support Java.  

In this case the files bscontactj.jar and content.wrl need to be placed in the directory in which the HTML page resides. The width and height attributes determine the size of 3D rendering area. Browsers that support Java (most if not all) automatically download the viewer code in bscontactj.jar; the applet then downloads the VRML content.

Note: earlier versions of BS Contact J (v < 2.2) used a different package structure. In this case you need to refer to the renderer with the following line instead of the one mentioned above:


In case you want to connect to the browser applet via Java or JavaScript, you need to specify a name in the name attribute, and you must also set the mayscript attribute to allow the browser applet to receive external calls.


Adding the following applet parameters can customize the operation of BS Contact J.


<param name=scene value="vrml/content.wrl">
Relative URL or URL of the scene to load.
Besides loading regular VRML files, BS Contact J offers the possibility of loading bx3D archives. These archives have the suffix ".bx3d" and contain all VRML files of the scene as well as all used textures. They can be created by using the bx3d wizard. Packing all used media files enables BS Contact J to download and initialize a 3D scene much faster than loading / initializing regular VRML files.
See the BS Contact J Wizard documentation for more info about how to create a bx3D archive.

<param name=loading value="static">
Defines the way BS Contact J behaves at loading time:
"static" loads everything before showing the scene;
"dynamic" when setting the loading flag to dynamic, BS Contact J will display the scene immediately. The textures will be added subsequently to the scene after being loaded. By using this flag the user will see an ("incompletely loaded") world much earlier than in static mode.
Default: static

<param name=version value="on">
If set to "on", BS Contact J shows the version number in the Java console while loading.
Default: off

<param name=statistics value="off">
If set to "on" BS Contact J shows statistics while playing a scene. This also enables the VRML diagnostic output to the Java console. Statistics shown:
*fps (frames per seconds)
*pnts (points calculated per frame)
*faces (faces drawn per frame)
*norms (normals calculated per frame)
*frm (number of total frames drawn)
Default: off

<param name=lighting value="on">
Switch illumination on or off. If set to "off" all lights in the scene are disabled. The scene will only appear illuminated with a full ambient light. This mode has the best rendering performance results.
Default: on

<param name=antialiasing value="oneshot">
Defines how often the renderer performs the anti-aliasing filter. Possible options:
"on" - enable true per pixel anti-aliasing on every rendered frame. Note this will significantly reduce rendering speed.
"off" - disable anti-aliasing
"oneshot" - the renderer performs the anti-aliasing filter on a static frame. This means that whenever the renderer has no continuous job to process (e.g. rendering of an animation) it will do a one-time anti- aliasing of the current frame. (recommended)
Default: oneshot
Bilinear Filtering

<param name=bilinear value="oneshot">
Bilinear filtering optimizes the rendered texture quality. Possible options:
"on" - enable bilinear filtering on every rendered frame. Note: this will significantly reduce rendering speed.
"off" - disable bilinear filtering
"oneshot" - the renderer performs the bilinear filtering on a static frame. This means that whenever the renderer has no continuousl job to do (e.g. rendering of an animation) it will do a one-time bilinear filtering of the current frame. (recommended setting)
Default: oneshot

<param name=textcolor value="ffffff">
Color for the text and for the loading bar (rrggbb in hex)
Default: ffffff

<param name=shadowcolor value="808080">
Shadow color of the text and the back of the loading bar
Default: 808080

<param name=backcolor value="202020">
Background color while loading (useful in setting the initial background color of the applet the same as the HTML page.)
Default: 505050

<param name=backimage value=
Progressive background image while loading. This parameter is useful in setting the initial background image of the applet. This picture is shown while downloading the VRML content.
Default: none

<param name=forceGC value="10000">
Forces a garbage collector call every n frames. Workaround to make sure that there is a memory clean up even with browsers with weak garbage collector implementation.
Default: 10000