Quick Start

First, include the SceneJS library in the <head> tag of your web page:

<script src="http://scenejs.org/api/latest/scenejs.js"></script>

Then build a scene. We'll make a spinning blue teapot:

var scene = SceneJS.createScene({ nodes:[ { type:"material", color: { r: 0.3, g: 0.3, b: 1.0 }, nodes:[ { type: "rotate", id: "myRotate", y: 1.0, angle: 0, nodes: [ { type:"geometry/teapot" } ] } ] } ] });

And voilà, one blue teapot:

Now let's start the teapot spinning:

scene.getNode("myRotate", function(myRotate) { var angle = 0; scene.on("tick", function() { myRotate.setAngle(angle += 0.5); }); });

Run this example

Plugins

Most of the node types you'll use with SceneJS are implemented by plugins, such as the geometry/teapot in this example. SceneJS will automatically load those types as required from the plugins directory within its repository on GitHub.

If you'd rather serve the plugins yourself, then just copy that directory to your server and configure SceneJS to load them from there, like so:

SceneJS.setConfigs({ pluginPath: "./foo/myPluginsDir" });