什么是 GLTF 动画采样器输入/输出值?

the*_*man 3 gltf

我正在阅读规范,但我无法理解采样器的属性。

这是我拥有的动画

"animations" : [
        {
            "channels" : [
                {
                    "sampler" : 0,
                    "target" : {
                        "node" : 0,
                        "path" : "translation"
                    }
                }
            ],
            "name" : "00001_2780.datAction",
            "samplers" : [
                {
                    "input" : 9,
                    "interpolation" : "CUBICSPLINE",
                    "output" : 10
                }
            ]
        },
        {
            "channels" : [
                {
                    "sampler" : 0,
                    "target" : {
                        "node" : 1,
                        "path" : "translation"
                    }
                }
            ],
            "name" : "00002_2780.datAction",
            "samplers" : [
                {
                    "input" : 9,
                    "interpolation" : "CUBICSPLINE",
                    "output" : 11
                }
            ]
        }
    ],
Run Code Online (Sandbox Code Playgroud)

我无法理解的是第一个样本的值是 9 和 10,而第二个样本的值是 9 和 11

我们在规范中所拥有的只是

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations

Each of the animation's samplers defines the input/output pair: a set of floating point scalar values representing linear time in seconds; and a set of vectors or scalars representing animated property. 
Run Code Online (Sandbox Code Playgroud)

这让我更不清楚。

是否有关于输入/输出值是什么以及它们代表什么的更详细的解释。例如,如果我将输入从 9 更改为 99 或 9.9 或 0.9 或 0 会发生什么。这将如何改变动画?

谢谢

ema*_*key 5

这里的数字 9 和 10 是 glTF 访问器索引 ID 值。如果您解码访问器索引 9,您将找到动画的每个关键帧的时间列表。如果您解码访问器 10,通常您会期望找到关键帧的值列表。但由于这是CUBICSPLINE,访问器 10 将包含每个关键帧的内切线、值和外切线。

调查glTF文件这样的一种方法是使用glTF工具扩展VSCode。您可以右键单击输入或输出值并选择Go To Definition以访问相关访问器,然后再次选择Go To Definition 对其进行解码。(免责声明,我是glTF Tools的贡献者)。