0

我是three.js 的新手。

我用这个画了一个简单的三角形。但是我怎样才能使它的厚度为 1,而不是平面几何?

var triangleGeometry = new THREE.Geometry(); 
triangleGeometry.vertices.push(new THREE.Vector3( 0.0,  1.0, 0.0)); 
triangleGeometry.vertices.push(new THREE.Vector3(-1.0, -1.0, 0.0)); 
triangleGeometry.vertices.push(new THREE.Vector3( 1.0, -1.0, 0.0)); 
triangleGeometry.faces.push(new THREE.Face3(0, 1, 2));
var triangleMaterial = new THREE.MeshBasicMaterial({ color:0xFFFFFF, side:THREE.DoubleSide }); 
var triangleMesh = new THREE.Mesh(triangleGeometry, triangleMaterial); 
triangleMesh.position.set(-1.5, 0.0, 4.0); 
scene.add(triangleMesh); '

谢谢你。

4

1 回答 1

0

我们需要添加三角形的所有面。所有点有 6 个顶点,所有 4 个面有 8 个面。注意顺序。

于 2016-07-13T19:19:55.397 回答