Why doesn't simple threejs animation work without Sampling? + Why does higher samplingrate result in smaller file?

Hi,

When exporting to GLTF for threejs the Blender to GLTF exporter gives us the option to use sampling to export animations. This is turned on by default.

However, when I turn this off, a simple animation on the rotation of an object doesn’t work anymore in ThreeJs. I’m rusprised about that.

I don’t quite get why this sampling is needed for simple pos/rot/scale animations as IMO we have all information already there without sampling to recreate it with threejs:

  • we know at what times the keyframes are set
  • we know the values at these keyframes
  • we know the curve type and positions of curve handles to shape the curves

Especially because, if I understand correctly what this sampling does (and works like sampling in audio), it takes more data to define the curves with sampling enabled and results in bigger file sizes.

So far I can’t find more information about this after searching.

I’ve looked inside the gltf, and see some variables have changed, but it’s not clear to me what exactly is going on and I expect most things for this are in the ‘buffers’ part of the gltf.

Does anybody here perhaps know:

- Why doesn’t simple threejs animation work without Sampling?

- Why does higher samplingrate result in smaller file (to me that doesn’t make sense as I would think more samples is bigger file)?