Skip to content

Instantly share code, notes, and snippets.

@rezoner
Created March 23, 2015 09:45
Show Gist options
  • Save rezoner/86b59077e39c42fdbf06 to your computer and use it in GitHub Desktop.
Save rezoner/86b59077e39c42fdbf06 to your computer and use it in GitHub Desktop.
Playground with Three.js - draft 2
var app = playground({
use: {
"three": {
renderer: "webgl"
},
},
create: function() {
this.setState(app.game);
}
});
app.game = {
create: function() {
var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
this.cube = new THREE.Mesh(geometry, material);
this.scene.add(this.cube);
},
step: function(delta) {
this.cube.rotation.z += 0.1 * delta;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment