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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -