我是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); '
谢谢。
答案 0 :(得分:0)
我们需要添加三角形的所有面。所有4个面的6个顶点和4个面的8个面。小心订单。