I'm currently exploring options to dynamically resize my threejs/webgl canvas using this function:
function resizeCanvas(){
$('#canvas').css('height', '100%');
$('#canvas').css('z-index', '1');
camera.aspect = window.innerWidth / parseInt($('#canvas').css('height'));
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, parseInt($('#canvas').css('height')));
}
While the function does the job, I am interested in achieving a smoother transition rather than an abrupt jump to 100%. Any suggestions on how to enhance this would be appreciated.