Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2013 05:14
Show Gist options
  • Save anonymous/6228192 to your computer and use it in GitHub Desktop.
Save anonymous/6228192 to your computer and use it in GitHub Desktop.
/**
* Loading a .obj file
*
* https://gist.github.com/brunofarache/5855622
*/
YUI().use('y3d-scene', 'y3d-camera', 'y3d-loader', 'io-base', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {
z: 290
}
}),
background: '#272822'
});
var io = new Y.IO({emitFacade: true}),
config = {
on: {
complete: function(event) {
var loader = new Y.Loader({ src: event.data.responseText });
var geometry = loader.load();
geometry.set('wireframe', true);
geometry.set('position.z', 50);
scene.add(geometry);
scene.render();
}
}
};
io.send('examples/obj/teapot.obj', config);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment