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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -