我需要制作一个面向另一个对象的3D多边形。有什么好办法吗?我考虑过使用ExtrudeGeometry,但我不知道如何将Object3D.lookat()函数应用于该函数。我将不胜感激:)
这是我现在拥有的代码:
var position = new THREE.Vector3(0,0,0);
var polyhedronPts = [];
polyhedronPts.push(new THREE.Vector2(-100, 600));
polyhedronPts.push(new THREE.Vector2(300, 600));
polyhedronPts.push(new THREE.Vector2(600, -100));
polyhedronPts.push(new THREE.Vector2(200, 100));
polyhedronPts.push(new THREE.Vector2(400, 200));
polyhedronShape = new THREE.Shape(polyhedronPts);
var extrudeSettings = {
amount: 5
};
var geometry = new THREE.ExtrudeGeometry(polyhedronShape, extrudeSettings);
geometry.lookAt(position);
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
mesh = new THREE.Mesh( geometry, material ) ;
sceneEl.object3D.add(mesh);
geometry.lookAt(sphereposition);线应使对象面向[0,0,0] 但事实并非如此。您知道如何解决此问题吗?