2

我通过 convert_obj_three.py 加载从 3DSMAX 导出的 .js 模型,并使用对象“纯色”显示它。

loader.load( 'try.js', function ( geometry, materials )
{
    var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials));
    scene.add( mesh );
});

渲染模式是基本的和描述性的(本例中没有材料)。现在我正在尝试添加边缘(“隐藏线”模式)来获得这种渲染(来自 3DSMAX 的图像)

目的是为 MeshFaceMaterial 添加彩色边缘(线条颜色将是与面相同的对象“纯色”)。

我注意到我们可以附加材料(就像在这个 stemkoski 示例中一样),但不能用我的材料 json 来做到这一点,你会怎么做?

4

1 回答 1

4

If your geometry is instanceof THREE.Geometry and not instanceof THREE.BufferGeometry (wireframe is not implemented for BufferGeometry) then you can achieve the effect you want by adding this line to your scene (in addition to the one you have):

scene.add (new THREE.Mesh (geometry,
    new THREE.MeshBasicMaterial ({ color: 0x00ffff, wireframe: true })));
于 2013-05-06T18:20:39.690 回答