I wrote a game class with coffeescript that displays a simple and rotating cube. You can see the code here: http://jsfiddle.net/6eRzt/6/
All dandies, except for two things:
1) I have to do an ugly hack to get a callback requestAnimationFrame:
var sh = new App();
sh.start();
function animate() {
sh.animate();
requestAnimationFrame(animate);
}
animate();
2) This is my main concern: SpotLight does not work. I tried to reproduce the behavior from another JSFiddle (link to this Question ), but to no avail. Maybe it's just a dumb typo, or maybe I'm doing it wrong.
Plus: Am I really wrong in my App class? All three.js examples I use use simple functions to get things going.
source
share