YUI3 WebGL module.
Check out the playground page, it contains some examples. Click on the Examples
button to load more scripts and learn how to use y3d.
Import YUI3:
<script src="http://yui.yahooapis.com/3.10.3/build/yui/yui-min.js"></script>
Import y3d:
<script src="http://brunofarache.github.io/y3d/build/y3d/y3d.js"></script>
Add a <canvas>
element to your page:
<canvas id='y3d'></canvas>
Create a scene and add a 3D object to it:
YUI().use('y3d-scene', 'y3d-camera', 'y3d-geometry-box', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {
z: 20
}
}),
background: '#272822'
});
var box = new Y.Box({
color: '#ff7700'
});
box.set('rotation', { x: 45, y: 45 });
scene.add(box);
scene.render();
});
Code is under YUI BSD License.