Skip to content

Instantly share code, notes, and snippets.

@AlexTiTanium
Created November 8, 2013 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexTiTanium/7369851 to your computer and use it in GitHub Desktop.
Save AlexTiTanium/7369851 to your computer and use it in GitHub Desktop.
/**
* Start main render loop
*/
beginRenderToContainer: function(container){
// Prepare render
this.scene.defaultCamera.updateProjectionMatrix();
this.container = container;
this.clock.start();
// Create render
this.renderer = new Renderer(this.container, this.scene);
// Schedule firs render step
self.requestAnimationFrame(this.renderStep.bind(this));
// Notify script engine and other about render start
this.events.trigger('render:start');
// Save last time
this.lastTime = this.clock.getElapsedTime();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment