three.js所从搅拌机
问题描述:
导出模型时
three.js所版本创建额外的面孔在我的Three.js场景中它们究竟是如何出现在Blender中的。这是我可以将它们用作模型的轮廓边框。例如,这里是默认的立方体的线框模型是有当您启动搅拌器:three.js所从搅拌机
这里是JSON这种模式后,我出口它:
{
"uvs": [],
"name": "CubeGeometry.1",
"materials": [{
"wireframe": true,
"DbgName": "Material",
"depthWrite": true,
"transparent": false,
"depthTest": true,
"specularCoef": 50,
"colorAmbient": [0.64,0.64,0.64],
"opacity": 1,
"vertexColors": false,
"DbgIndex": 0,
"DbgColor": 15658734,
"shading": "phong",
"visible": true,
"colorEmissive": [0,0,0],
"blending": "NormalBlending",
"colorSpecular": [0.5,0.5,0.5]
}],
"faces": [35,0,1,2,3,0,0,1,2,3,35,4,7,6,5,0,4,5,6,7,35,0,4,5,1,0,0,4,7,1,35,1,5,6,2,0,1,7,6,2,35,2,6,7,3,0,2,6,5,3,35,4,0,3,7,0,4,0,3,5],
"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],
"metadata": {
"uvs": 0,
"materials": 1,
"generator": "io_three",
"vertices": 8,
"faces": 6,
"normals": 8,
"type": "Geometry",
"version": 3,
"colors": 0
},
"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],
"colors": []
}
公告如何有6面。我希望它在我的Three.js场景中完全像这样。然而,额外的面孔被绘制。这通常是因为Three.js连接了Blender中没有连接的顶点。下面是它的外观后,我将其加载到我的场景:
答
要渲染的线框模式,但没有对角线立方体或盒子。要做到这一点
一种方法是用EdgesHelper
,就像这样:
var helper = new THREE.EdgesHelper(mesh, 0xff0000);
helper.material.linewidth = 2;
scene.add(helper);
您还可以看到this related answer。
three.js所r.71
见http://stackoverflow.com/questions/20153705/three-js-wireframe-material-all-polygons-vs-just-edges/20154589#20154589 – WestLangley
从这答案,我用** ** THREE.EdgesHelper像这样: '变种EGH =新THREE.EdgesHelper(目,0x00ffff); egh.material.linewidth = 2; scene.add(EGH);' 这工作,所以请注明随着你的答案,我会接受它=) –