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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -