Three.js,向网格几何三角形添加厚度
Three.js, adding thickness to mesh geometry triangle
我是 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); '
谢谢。
我们需要添加三角形的所有面。所有点有 6 个顶点,所有 4 个面有 8 个面。注意顺序。
我是 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); '
谢谢。
我们需要添加三角形的所有面。所有点有 6 个顶点,所有 4 个面有 8 个面。注意顺序。