Math.min(Math.max(Math.pow((now - startTime) / (endTime - startTime), 0.2), 0), 1);
      const scaleFactor = startScale*(1-factor) + endScale*factor;

      rig.scale.set(scaleFactor, scaleFactor, scaleFactor);
      rig.visible = rig.scale.x > 0.00001;

      if (factor >= 1) {
        rig.animation = null;
      }
    },
  };
};

const cacheCanvas = document.createElement('canvas');
cacheCanvas.width = 1024;
cacheCanvas.height = 1024;
const cacheCanvasCtx = cacheCanvas.getContext('2d');

// box meshes

c