code: function resize() {
      var w = $(window).width(), h = $(window).height();
      canvas.attr({ width: w, height: h });
      scene.getCamera().setAspect(w / h);
      renderer.clearViewport();
    }
docs: Handle canvas resizing (buggy)