Skip to content
Kristian Sons edited this page Jul 16, 2013 · 25 revisions

Requirements

xml3d.js runs on any browser with WebGL support.

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 elements that allow you to add 3D content inside your web document.

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