상세 컨텐츠

본문 제목

resize - Three.js

three.js

by 폴리프레임 2024. 11. 22. 12:48

본문

반응형

Three.js 활용시 resize 활용예제

window.addEventListener('resize', onWindowResize);

 

function onWindowResize(){

   camera.aspect = window.innerWidth / window.innerHeight ;

   camera.updateProjectionMatrix();

   renderer.setSize( winow.innerWidth, window.innerHeight );

}

 

'three.js' 카테고리의 다른 글

touch event - @react-three/fiber  (2) 2024.11.23
video backgorund with @react-three/fibre  (1) 2024.11.22
lookAt(), getWorldDirection()  (1) 2024.11.21
Capsule class  (2) 2024.11.21
Octree  (0) 2024.11.21

관련글 더보기