Using Cult3D objects on the WWW

The technique used to embed a Cult3D object in an HTML page in a way that is compatible both with Netscape Navigator (version 2.0 or later) and Internet Explorer (version 3.0 or later) is, unfortunately, somewhat complex. Luckily, there is a "recipe" which you can follow, and which is described in the following sections. If you're not interested in the details, just read the sections "Preparing your web server", "The basic recipe" and "Cult3D plug-in parameters", and have a look at the examples in the last section. If you want to know what the various fixed attributes do, you may also want to read the section "Specific OBJECT and EMBED element attributes". If you want to understand why you have to do things in such a contrived way, you should also read the section "Some technical details".

Preparing your web server

In order for your visitor's browser to recognize a Cult3D object, you have two options. The better is to install the Cult3D MIME type "application/x-Cult3D-object" with the file suffix/extension ".co" on the web server at which your object resides. (Your webmaster should know how to do this.) If for some reason this is not possible, you should instead use the TYPE attribute in the EMBED element (see EMBED attributes element in section "Specific OBJECT and EMBED element attributes" below).

The basic recipe

To use a Cult3D object in your HTML page you need to specify some information for the browser. The minimum it should know is where the object resides and the width and height of the window showing the object. You may also want to send some optional parameters to the Cult3D plug-in, to further specify the appearance and behavior of your object.

To embed a Cult3D in your HTML page you can use the following "skeleton":

    <OBJECT CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"

    CODEBASE="http://www.cult3d.com/download/cult.cab"

    WIDTH=width

    HEIGHT=height

    >

    <PARAM NAME="SRC" value=source-url>

    more object parameters

    <EMBED

    TYPE="application/x-cult3d-object"

    PLUGINSPAGE="http://www.cult3d.com/newuser/index.html"

    SRC=source-url

    WIDTH=width

    HEIGHT=height

    more embed parameters

    >

    </EMBED>

    </OBJECT>

Copy the skeleton into your HTML page and supply the appropriate width, height, source-url and, if applicable, more parameters. As you see, you need to specify all parameters twice, once for the OBJECT element and once for the EMBED element. Follow these steps:

1. Supply the source-url. This is the location of your Cult3D object. (You need to insert this in two places.)
2. Supply the width and height. This is the size of your Cult3D object's sub-window in your page, in pixels. (You also need to insert these in two places.)
3. If your web server already has a registered MIME type for Cult3D objects, remove the TYPE attribute from the EMBED element.
4. Determine if you need to specify any further parameters. These are described in the section "Cult3D plug-in parameters" below. For each parameter param with value value, insert one line in the more object parameters part on the form
   <PARAM NAME="param" VALUE=value>
   and one line in the more embed parameters part on the form
   param=value

So, for example, let's say you want to insert the object "myobject.co" in your HTML page. You want it to appear in a sub-window that is 240 pixels high and 320 pixels wide, and you want it to rotate about the Y-axis at a speed of 0.5 revolutions/second. Let's assume your web server is configured correctly, so you don't need the TYPE attribute. Following the steps above should give you the following:

    <OBJECT

    CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"

    CODEBASE="http://www.cult3d.com/download/cult.cab"

    WIDTH=320 HEIGHT=240>

    <PARAM NAME="SRC" VALUE="myobject.co">

    <PARAM NAME="AXIS" VALUE="Y">

    <PARAM NAME="SPEED" VALUE="0.5">

    <EMBED

    PLUGINSPAGE="http://www.cult3d.com/newuser/index.html"

    SRC="myobject.co"

    WIDTH=320 HEIGHT=240

    AXIS="Y"

    SPEED="0.5">

    </EMBED>

    </OBJECT>

This should work.

Specific OBJECT and EMBED element attributes

This section describes the various attributes specific to the OBJECT and EMBED elements. You don't need to read this to get a Cult3D object onto your web site, but we still recommend that you at least gloss through this information, to get a better understanding what's going on.

OBJECT element attributes

- CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"
  The CLASSID and the related clsid: modifier is a confirmation that we are using ActiveX. The number following clsid is the class identifier for the Cult3D plug-in, and it is important that you don't make any typing errors when putting this into your HTML page.

- CODEBASE="http://www.cult3d.com/download/cult.cab""
  If the ActiveX control isn't already installed, this parameters tells the browser where it can be found for download. When it is downloaded, your system checks its digital signature and automatically installs it.

EMBED element attributes

- PLUGINSPAGE="http://www.cult3d.com/newuser/index.html"
  This attribute indicates where the user should go to get the Cult3D plug-in. You should include it with every Cult3D object, exactly as written above. This will make life much easier for visitors who don't already have the Cult3D plug-in, as it will prompt their browsers to help them get the latest version, with a minimum amount of hassle, straight from the original source. It will greatly enhance the user friendliness of your site. For the sake of your Netscape visitors you should regard this attribute as mandatory!

- TYPE="application/x-cult3d-object"
  If the web server your site resides at doesn't have a registered MIME type for Cult3D objects, you should set it yourself with this attribute.

Cult3D plug-in parameters

There are a number of optional parameters that you may use to modify the (initial) appearance of your object:

- INITROTX=initial rotation X
- INITROTY=initial rotation Y
- INITROTZ=initial rotation Z
  Initial rotation of the object about the X-, Y- and Z-axis, respectively. It modifies the initial static viewing angle; it does not cause the object to rotate continuously (see the AXIS and SPEED attributes on how to achieve that effect). The angles are given in degrees, and rotations are performed relative to the screen, in the order they occur. The X-axis points horizontally to the right, the Y-axis vertically towards the top of the screen, and the Z-axis into the screen (away from the viewer).

- AXIS=rotation axis
- SPEED=rotation speed
  These two attributes define the initial motion of the object. The object is made to rotate about the indicated axis at the indicated speed. The rotation axis is given by a vector "x, y, z", which does not have to be normalized. (So, for example, AXIS="0,5,0" would cause the object to rotate around the Y-axis.) For your convenience, you may use "X", "Y" or "Z" for the principal axes. (So instead of writing AXIS="0,5,0", you may just as well write AXIS="Y".) The speed is given in revolutions per second. (So SPEED=2 means that the object should complete two revolutions in one second, and SPEED=0.5 that it should complete half a revolution in one second.)

- BGCOLOR=background color
  The background color of the object, given in standard HTML hexadecimal RGB notation.

- RESIZE=scale
  Changes the scale of the object. The size of the object is multiplied by scale. So, for example, RESIZE=2 makes the object twice as large, while RESIZE=0.25 makes it a quarter its original size.

- LINK=url
- TARGET=banner
  The LINK attribute links your object to url. Clicking the object takes the user to url. As clicking the object takes the user straight to a new URL, all interactivity with the object is lost. If you want url to be opened in a specific frame, you may specify that with the TARGET attribute. So, for example, LINK=" http://www.Cult3D.com" together with TARGET="cultframe" will open the URL <http://www.Cult3D.com> in the frame cultframe.

Some technical details

Why do we have to do things in such a roundabout way? Well, the problem stems from the fact that Internet Explorer and Netscape use different mechanisms to extend their run-time behavior with plug-ins.

Netscape started supporting plug-ins long before there was a standard for it. They did so by introducing the EMBED element and defining their own plug-in format. The EMBED element has never been part of the official HTML standard, but it is supported, more or less, by many browsers on the market.
When this kind of functionality was later standardized in HTML 3.2, it was done through the introduction of the OBJECT element. Internet Explorer uses this to identify an ActiveX control to be used with the plug-in data.

So what we have is two different mechanisms by which the behavior of a browser can be extended: the EMBED element for Netscape plug-ins, and the OBJECT element for (among other things) ActiveX controls. Internet Explorer does support the former, to some extent (but not well enough to be compatible with Cult3D). Netscape pre-4.0 doesn’t support the latter at all, and though Netscape 4.0 does, it doesn’t know how to deal with ActiveX controls.

Fortunately, the OBJECT element is designed to deal with this kind of problems. "Old-time" browsers (such as Netscape pre-4.0) that aren’t aware of the OBJECT element will just ignore it, and all enclosed PARAM elements, as it doesn’t know what to do with them; they will, however, try to interpret anything else enclosed in the OBJECT, such as an EMBED element. Newer browsers, that are aware of the OBJECT element, but that don’t support its use with ActiveX controls (such as Netscape 4.0) will do the same. And browsers that support the use of the OBJECT element for specifying ActiveX controls (such as Internet Explorer 3.0 or newer) will interpret it, together with any enclosed PARAM elements, and ignore anything else enclosed in the OBJECT, such as an EMBED element. So, if we use the "skeleton" described above, we have a piece of HTML code that will cause Netscape to see an EMBED element, and Internet Explorer to see an OBJECT element specifying an ActiveX control—which is what we wanted.

A couple of concluding examples

We conclude with a couple of examples of how an embedded Cult3D object might actually look in
an HTML page. Example #1:

    <OBJECT

    CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"

    CODEBASE="http://www.cult3d.com/download/cult.cab"

    WIDTH=300 HEIGHT=250>

    <PARAM NAME="SRC" VALUE="cycoke.co">

    <PARAM NAME="INITROTX" VALUE=0>

    <PARAM NAME="INITROTY" VALUE=0>

    <PARAM NAME="INITROTZ" VALUE=180>

    <EMBED

    PLUGINSPAGE="http://www.Cult3D.com/newuser/index.html"

    SRC="cycoke.co"

    WIDTH=300 HEIGHT=250

    INITROTX=0

    INITROTY=0

    INITROTZ=180>

    </EMBED>

    </OBJECT>

Example #2:

    <OBJECT

    CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"

    CODEBASE="http://www.cult3d.com/download/cult.cab"

    WIDTH=320 HEIGHT=240>

    <PARAM NAME="SRC" VALUE="objects/cult3dcube.co">

    <PARAM NAME="BGCOLOR" VALUE="ffffff">

    <PARAM NAME="AXIS" VALUE="Y">

    <PARAM NAME="SPEED" VALUE="0.01">

    <PARAM NAME="LINK" VALUE="http://www.Cult3D.com">

    <EMBED

    PLUGINSPAGE="http://www.Cult3D.com/newuser/index.html"

    SRC="objects/cult3dcube.co"

    WIDTH=320 HEIGHT=240

    BGCOLOR="ffffff"

    AXIS="Y"

    SPEED="0.01"

    LINK="http://www.Cult3D.com">

    </EMBED>

    </OBJECT>

Happy webbing!

Cult3D is a trademark of Cykar Computers - Cykår AB. All other brand names, product names, or trademarks belong to their respective holders.