【问题标题】:Manipulate the 3 Dimensions in Three.js from json object exported by Blender从 Blender 导出的 json 对象操作 Three.js 中的 3 个维度
【发布时间】:2016-02-24 06:01:56
【问题描述】:

我想知道是否有办法让用户从我的网站手动操作由 Blender 创建并由 exporter 以 json 格式导出的 3d 对象。 我希望用户更改对象的长度宽度高度。 例如,我有这个简单的 json 格式的多维数据集

{
"metadata": {
    "generator": "io_three",
    "type": "Geometry",
    "vertices": 8,
    "faces": 6,
    "uvs": 0,
    "normals": 8,
    "version": 3
},
"uvs": [],
"name": "CubeGeometry",
"faces": [33,0,1,2,3,0,1,2,3,33,4,7,6,5,4,5,6,7,33,0,4,5,1,0,4,7,1,33,1,5,6,2,1,7,6,2,33,2,6,7,3,2,6,5,3,33,4,0,3,7,4,0,3,5],
"normals": [0.577349,-0.577349,-0.577349,0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,0.577349,0.577349,0.577349,0.577349],
"vertices": [1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,-1,0.999999,1,1,-1,1,1,-1,1,-1]

}

我希望用户能够通过在表单中​​输入数字来更改 3 维,而不是鼠标药物。

谢谢!

【问题讨论】:

    标签: javascript json three.js blender


    【解决方案1】:

    好的,我找到了。如果有人想知道解决方案是

    var model = new THREE.Object3D();
    model.add(object);
    model.scale.set(x,y,z);
    

    object 是你的对象:p

    【讨论】:

      猜你喜欢
      • 2015-03-28
      • 2017-08-24
      • 2014-12-25
      • 2017-09-29
      • 2018-05-01
      • 2013-11-09
      • 2019-03-30
      • 2023-03-20
      • 2012-04-04
      相关资源
      最近更新 更多