Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2013 21:03
Show Gist options
  • Save anonymous/5853588 to your computer and use it in GitHub Desktop.
Save anonymous/5853588 to your computer and use it in GitHub Desktop.
YUI().use('y3d-anim', 'y3d-scene', 'y3d-camera', 'y3d-geometry-box', 'y3d-geometry-sphere', 'y3d-texture', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
z: 20
}),
background: '#272822'
});
var box = new Y.Box({
texture: 'images/grass.png',
x: 3
});
scene.add(box);
var sphere = new Y.Sphere({
radius: 3,
texture: 'images/moon.gif',
x: -3,
});
scene.add(sphere);
var animation = function() {
box.rotate('xy', 3);
sphere.rotateY(1);
};
var anim = new Y.WebGLAnim(scene, animation);
new Y.TextureLoader({
onLoad: function() {
anim.start();
},
textures: [box.get('texture'), sphere.get('texture')]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment