Three.js 006Fullscreen and Resizing

Summary

  • Set canvas size to viewport size window.innerWidth and window.innerHeight.
  • Added resize event listener to update canvas size, camera aspect ratio and projection matrix, renderer size and pixel ratio (window.devicePixelRatio).
  • Added dblclick event listener to toggle fullscreen mode.

Loading...

Open example in a new tab.

Links