Created
March 23, 2015 09:45
-
-
Save rezoner/86b59077e39c42fdbf06 to your computer and use it in GitHub Desktop.
Playground with Three.js - draft 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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