Skip to content

digitaledge/xeoEngine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xeoEngine

xeoEngine is a message-driven WebGL engine built on ActorJS and SceneJS that lets you create and manage 3D worlds over a network.

At this early stage, xeoEngine is in a state of flux as I explore what kind of functionality I should put in the actors, but over time it should settle down into something that other people can build on. Please hit the issue tracker if you have any ideas.

Concept

Via JSON-RPC, xeoEngine lets us plug actors together to create a 3D world, then fire calls at the actors to make the world do stuff. xeoEngine dynamically loads actors from libraries of AMD modules, and the aim is to build an extensive library of those actors from which we select as required for each app built on xeoEngine.

To use xeoEngine, embed the server page in an iframe:

<iframe id="myIFrame" style="width:800px; height:600px;"
src="http://xeolabs.github.com/xeoEngine/server.html"></iframe>

link to the xeoEngine client library:

<script src="http://xeolabs.github.com/xeoEngine/client.js"></script>

then create a client and drive the xeoEngine server page through it:

/* Create a client
 */
var engine = new xeoEngine({
    iframe: "myIFrame"
});

/* Add a scene actor
 */
engine.call("addActor", {
    type: "scene",
    actorId: "myScene"
});

/* Add a teapot to the scene
 */
engine.call("myScene/addActor", {
    type: "objects/prims/teapot",
    yPos: 2
});

/* Add a camera to the scene
 */
engine.call("myScene/addActor", {
    type: "camera",
    actorId: "myCamera"
});

/* Subscribe to "eye" messages published by the camera whenever its eye
 * position changes. See how we specify a path down through the actor hierarchy
 * to the camera actor's "eye" topic.
 */
engine.subscribe("myScene/myCamera/eye",
    function (update) {
        var eye = update.eye;
        //..
    });

/* Call a method on the camera to set the eye position.
 * This will cause the camera to publish an "eye" message,
 * which we'll handle with the subscription we made above.
 */
engine.call("myScene/myCamera/setEye", {
    x: -30,
    y: 0,
    z: 50
});

Examples

Find a growing collection of examples over at CodePen

Documentation

To get the gist of xeoEngine, take a look at

License

xeoEngine is licensed under both the GPL and MIT licenses.

Pick whichever fits your needs.

About

Create and manage WebGL-based 3D worlds over a network using JSON-RPC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published