【问题标题】:What are the GLTF animations sampler input/output values?什么是 GLTF 动画采样器输入/输出值?
【发布时间】:2019-12-07 04:20:27
【问题描述】:

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

这是我的动画

"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
                }
            ]
        }
    ],

我无法理解的是第一个样本的值 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. 

这让我更不清楚。

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

谢谢

【问题讨论】:

    标签: gltf


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2020-05-13
      • 1970-01-01
      • 2014-12-31
      • 1970-01-01
      • 1970-01-01
      • 2020-10-23
      • 1970-01-01
      相关资源
      最近更新 更多