Skip to content

Instantly share code, notes, and snippets.

/**
* y3d is a WebGL library built with yui3
*
* https://github.com/brunofarache/y3d
*/
/**
* Examples: load y3d scripts from gists, click on it to see more examples
* Save: saves code to anonymous public gist
* Run: runs code (Crtl+U shortcut)
/**
* https://gist.github.com/brunofarache/5819929
*/
YUI({ gallery: 'gallery-2013.10.24-18-05' }).use('gallery-y3d', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {
z: 20
}
/**
* Click on the left canvas and then move camera with wasd keys.
* Use mouse wheel to zoom in and zoom out.
*
* https://gist.github.com/brunofarache/5853591
*/
YUI().use('y3d-anim', 'y3d-scene', 'y3d-camera', 'y3d-geometry-box', 'y3d-geometry-sphere', 'y3d-texture', function(Y) {
var camera = new Y.Camera({
position: {
/**
* Click on the box, it should change to a random color.
*
* https://gist.github.com/brunofarache/5855622
*/
YUI().use('y3d-picker-plugin' ,'y3d-scene', 'y3d-geometry', 'node', function(Y) {
var scene = new Y.Scene({
background: '#272822'
});
/**
* Loading a teapot.obj file
*
* https://gist.github.com/brunofarache/6228194
*/
YUI().use('y3d-scene', 'y3d-camera', 'y3d-obj-loader', 'io-base', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {