Json加载器多个几何 - 语法

时间:2015-03-23 13:10:50

标签: json syntax import three.js

我正在尝试导入多个几何图形,例如两个不同且分开的立方体,只有一个.json文件。

该型号不是来自Blender。在我的代码中,我刚刚使用了一个简单的JSONLoader,没有材料。 我找不到正确的语法。 这是一个示例几何,加载得很好:

"vertices": [0.0, 0.0, 0.0,0.0, 25.25, 0.0,46.0, 25.25, 0.0,46.0, 0.0, 0.0,0.0, 25.25, 0.0,0.0, 0.0, 0.0,0.0, 0.0, 25.25,0.0, 25.25, 25.25,0.0, 0.0, 0.0,46.0, 0.0, 0.0,46.0, 0.0, 25.25,0.0, 0.0, 25.25,46.0, 0.0, 0.0,46.0, 25.25, 0.0,46.0, 25.25, 25.25,46.0, 0.0, 25.25,46.0, 25.25, 0.0,0.0, 25.25, 0.0,0.0, 25.25, 25.25,46.0, 25.25, 25.25,0.0, 0.0, 25.25,46.0, 0.0, 25.25,46.0, 25.25, 25.25,0.0, 25.25, 25.25],

"uvs": [[0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,-1.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0]],

"faces": [0,0,1,2,0,4,5,6,0,8,9,10,0,12,13,14,0,16,17,18,0,20,21,22,0,0,2,3,0,4,6,7,0,8,10,11,0,12,14,15,0,16,18,19,0,20,22,23]

假设我想在同一个JSON下添加另一个单独的几何体,可能有不同的名称。 什么是正确的语法? 我已经检查过了:

  • 先生。 doob JSON模型格式3和JSON几何格式4语法,不引用多个几何
  • 从Blender导出的示例模型的语法。这使用“几何”属性来存储顶点和面。仍然不适合我。
  • Three.js附带的示例始终导入单个几何体。

0 个答案:

没有答案