0

I'm new to three.js.

I draw a simple triangle with this. But how can I make it 1 height of thickness, instead of plane geometry?

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); '

Thank you.

Łukasz
  • 2,131
  • 1
  • 13
  • 28
Martin Pineault
  • 87
  • 1
  • 14

1 Answers1

0

We need to add all faces of the triangle. 6 vertices for all points and 8 faces for all 4 faces. Beware of the order.

Martin Pineault
  • 87
  • 1
  • 14