javascript - THREEjs resizing canvas with click -
i'm trying find way resize threejs/webgl canvas function
function resize(){ $('#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'))); }
it gets job done, jumps 100% , wondering if there way smooth transition
you can use css transitions if aren't strict on backward compatibility.
https://developer.mozilla.org/en-us/docs/web/css/css_transitions/using_css_transitions
Comments
Post a Comment