The following examples show how to place an X3D object within an HTML page.
X3D plugin object (if installed) | No X3D plugin installed | HTML source | ||
---|---|---|---|---|
Online example scene: | Anchor-link text backup: | |||
Select an X3D plugin to see this example... | <html> <body> <object data="http://www.web3d.org/x3d/content/examples/HelloWorld.x3d" type="model/x3d+xml" height="360" width="300"> <param name="src" value="http://www.web3d.org/x3d/content/examples/HelloWorld.x3d"/> <param name="DASHBOARD" value="FALSE"/> <param name="SPLASHSCREEN" value="FALSE"/> <!-- the following anchor-link text is only displayed to user if no X3D plugin is already installed --> <div class="noX3dPluginInstalled"> <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html#Applications" target="helpPage"> Select an X3D plugin to see this example...</a> </div> </object> </body> </html> |
|||
Online example scene: | Anchor-link image backup: | |||
<html> <body> <object data="http://www.web3d.org/x3d/content/examples/HelloWorld.x3d" type="model/x3d+xml" height="360" width="300"> <param name="src" value="http://www.web3d.org/x3d/content/examples/HelloWorld.x3d"/> <param name="DASHBOARD" value="FALSE"/> <param name="SPLASHSCREEN" value="FALSE"/> <!-- the following anchor-link image is only displayed to user if no X3D plugin is already installed --> <div class="noX3dPluginInstalled"> <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html#Applications" target="helpPage"> <img src="HelloWorldTall.png" height="360" width="300" alt="Click image to select an X3D plugin" /> </a> </div> </object> </body> </html> |
classid
attribute needs to be avoided, since it restricts display of the
X3D scene to only one specific browser, regardless of whatever X3D plugin might already be installed.
<param>
options which allow further customization,
and usually forces that particular plugin to be used.
Be careful to avoid breaking compatibility among multiple browswers when using such options.
<param name="src" value="...same url as data attribute..." />
entry appears to be redundant and may be eliminated once X3D plugins get more consistent.
<param>
name-value pairs.
Thanks to X3D/HTML experts Joe Williams (Hypermultimedia) and Leonard Daly (Daly Realism) for their help troubleshooting this design pattern among multiple X3D browsers.
Questions, suggestions and comments about these resources are welcome. Please send them to Don Brutzman (brutzman at nps.edu)
Available online at http://www.web3d.org/x3d/content/examples/HtmlObjectTagForX3d.html
Updated: 15 May 2010