【问题标题】:Collada geometry mesh triangles node's NORMAL offset attributeCollada 几何网格三角形节点的 NORMAL 偏移属性
【发布时间】:2022-09-28 07:36:35
【问题描述】:

我试图了解属性 \"offset\" 对 collada .dae 文件中三角形/法线的值的确切作用。

例如,假设我们在几何节点内的网格节点中有这个:

<triangles count=\"4\">
    <input semantic=\"VERTEX\" source=\"#some-mesh-vertices\" offset=\"0\"/>
    <input semantic=\"NORMAL\" source=\"#some-mesh-normals\" offset=\"1\"/>
    <p>0 0 1 0 2 0 2 0 1 0 3 1 4 2 5 2 6 2 6 2 5 2 7 2</p>
</triangles>

\"1\" 的值是否对法线或三角形......或两者都有作用?究竟是什么......它移动了法线/三角形数组元素,或者为它们添加了一些值?我正在努力理解它,因为我正在用它为 Java 中的 3D 模型构建数组,所以当然,如果没有这些知识,它会给我带来错误,因为偏移值必须具有一些我还没有得到的含义。

    标签: java attributes offset collada normals


    【解决方案1】:

    偏移量仅描述如何读取列表。

    在此示例中,您将读取每隔一个数字,但从给定的偏移量开始。

    <input semantic="VERTEX" source="#some-mesh-vertices" offset="0"/>
    <input semantic="NORMAL" source="#some-mesh-normals" offset="1"/>
    <p>0 1 2 3 4 5 6 7</p>
    
    vertexIndices = [0,2,4,6]
    normalIndices = [1,3,5,7]
    

    然后,这些索引将用于从其来源获取实际值。

    【讨论】:

      猜你喜欢
      • 2015-11-30
      • 2013-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-15
      • 2020-08-03
      • 1970-01-01
      相关资源
      最近更新 更多