从Blender导出的json对象中处理Three.js中的3维

时间:2023-02-05 19:35:13

I was wondering if there is a way for the user to manipulate manually from my website a 3d object that was created by Blender and exported in json format by this exporter. I want the user to change the Length Width Height of the object. For example i have this simple cube in json format

我想知道用户是否有办法从我的网站手动操作由Blender创建并由此导出器以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]

}

and i want the user to be able to change the 3 dimensions by typing numbers in a form, not mouse drug.

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

Thanks!

1 个解决方案

#1


0  

Ok i found it. If anyone wonders the solution is

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

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

where object is your object :p

对象是你的对象:p

#1


0  

Ok i found it. If anyone wonders the solution is

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

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

where object is your object :p

对象是你的对象:p