Future to the fantasy ★ ★
X3D Editor

Cobweb 3.2

WebGL X3D Browser

Something special, something more!


A full standard compliant VRML browser!

Accessing The External Browser

There is the X3D object which is always available, it expects at least one function handler that is called when the <X3D> tags (browsers) are ready, or the second function handler is called if an error occurred.

X3D (callback[, errorCallback]);  

The callback function is called when the browser is available. The callback function takes one argument elements, that holds all X3D tags;

function callback (elements)

The elements can than be used to access the browser of an X3D tag like below:

X3D (function (element)
   var browser = X3D .getBrowser (element);
   browser .loadURL (new X3D .MFNode ("/path/to/your/world.x3dv"), new X3D .MFNode ());

If you want access to a specific browser:

X3D (function (elements)
   var browser = X3D .getBrowser (elements [0]);

It is also possible to access a browser by a CSS class or its id:

function foo ()
   var browser = X3D .getBrowser ("#browser-id");

If something went wrong, the error callback is called:

X3D (function (elements)
   var browser = X3D .getBrowser (elements);
function (elements)
   // Error callback, no browser.

X3D International Standards

Cobweb is based on the the X3D International Standard and this standard is available online on web3d.org on the pages listed below. You can read there all about node types and JavaScript functions and properties available.

X3D Specifications

Language bindings

X3D Examples