LoginSignup
1
1

More than 5 years have passed since last update.

ウィンドウのリサイズ時の処理

Last updated at Posted at 2016-08-11

REVISION: '78'

cameraのaspect、rendererのsizeを一緒に更新する必要がある。

function onResize() {
    camera.aspect = window.innerWidth / window.innerHeight;
    camera.updateProjectionMatrix();
    renderer.setSize(window.innerWidth, window.innerHeight);
}
// listen to the resize events
window.addEventListener('resize', onResize, false);

参考
初めてのThree.js 第2版――WebGLのためのJavaScript 3Dライブラリ

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1