While working on a new WebVR project, it somehow felt that setRenderLoop()
would be a better name than animate()
but I’m unsure.
var renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setRenderLoop( render );
document.body.appendChild( renderer.domElement );
function render( timestamp ) {
renderer.render( scene, camera );
}
Thoughts?
startAnimationLoop
may sound less alien.Because the WebVR API has its own
requestAnimationFrame
and renders black if you usewindow.requestAnimationFrame
.Ended up going with
setAnimationLoop()
.With the current implementation you can do this: