Skip to content
lachsen edited this page Feb 27, 2013 · 25 revisions

Requirements

XML3D with xml3d.js potentially runs on any browser with WebGL support. However, in practice we only test support for the following browsers:

  • Chrome
  • Firefox

Interested in adding support for other browsers? Just contact us!

Enable XML3D

To make XML3D work, all you need to do is include the xml3d.js library in your XHTML document.

Just make sure, that you include xml3d.js as the very first js library in your document, like so:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- Your usual header stuff, but NO <script> -->
    <script src="http://www.xml3d.org/xml3d/script/xml3d.js"></script>
    <!-- Other <script> tags -->
</head>

Important things to remember:

  • xml3d.js currently only works in XHTML documents
  • Always add the xml3d.js library first for all JavaScript libraries! (Yes, even before jquery.)

Write XML3D

XML3D is an extension to HTML. It defines a small set of element that need to be written inside your XHTML document in order to display 3D content.

To work with XML3D, you need to understand the set of XML3D elements. Good news: there are only few of them. Currently less then 20.

Here some options on how to learn XML3D:

Using Camera Controller

If a standard navigation mode is sufficient for your web application, you can include the camera controller that comes with xml3d.js:

    <script src="http://www.xml3d.org/xml3d/script/xml3d.js"></script>
    <script src="http://www.xml3d.org/xml3d/script/tools/camera.js"></script>

Clone this wiki locally