I'm trying to create a 3D Polygon that can face another Object, but I'm struggling to figure out how to do it. I was thinking of using ExtrudeGeometry, but I'm not sure how to apply the Object3D.lookat() function to it. Any suggestions would be greatly appreciated :)
Here is the code I have so far:
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);
The geometry.lookAt(sphereposition); line should make the object face [0,0,0] but it doesn't. Can anyone help me troubleshoot this issue?