I have the desire to create a triangle with known angles (Alpha, Beta, Gamma) and side lengths (10).
In order to draw a triangle, I must assign 3 vertices to the geometry with specific Vector3 values.
Does THREE.js offer any tools or techniques suitable for this task?
geometry.vertices.push(
new THREE.Vector3( 0, 0, 0 ),
new THREE.Vector3( -10, -10, 0 ),
new THREE.Vector3( 10, -10, 0 ),
);
geometry.faces.push( new THREE.Face3( 0, 1, 2 ));
var material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
var mesh = new THREE.Mesh( geometry, material );
The only method in THREE.js that comes to mind is creating a 2 vector geometry with distances equal to side lengths, utilizing matrix translation to establish rotation center at vector[0], adjusting its position and rotation, and then applying globalToWorld() for vector[1]. However, I believe this may not be the most optimal solution.