尝试从Vector3三角形中挤出三角形网格。我在extrudeSettings
中呼叫var triangleGeometry = new THREE.Geometry(extrudeSettings);
,但它没有挤出。我在这里做错了什么?
以下是相关的JS:
drawTriangle(
new THREE.Vector3(0, 0, 0),
new THREE.Vector3(4, 0, 0),
new THREE.Vector3(2, 3.4641, 0)
);
var extrudeSettings = {
steps : 100,
bevelEnabled : false,
extrudePath : closedSpline
};
function drawTriangle (vertex1, vertex2, vertex3) {
var triangleGeometry = new THREE.Geometry(extrudeSettings);
var triangleMaterial = new THREE.MeshBasicMaterial({
color: 0x000000,
wireframe: true,
wireframeLinewidth: 1
});
var triangle = new THREE.Mesh(triangleGeometry, triangleMaterial);
triangleGeometry.vertices = [vertex1, vertex2, vertex3];
triangleGeometry.faces.push(new THREE.Face3(0, 1, 2));
THREE.GeometryUtils.center(triangleGeometry);
scene.add(triangle);