Answers for "make triangle with threejs"

0

make triangle with threejs

let geom = new THREE.Geometry();
let v1 = new THREE.Vector3(0,0,0);
let v2 = new THREE.Vector3(30,0,0);
let v3 = new THREE.Vector3(30,30,0);

geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);

geom.faces.push( new THREE.Face3( 0, 1, 2 ) );
geom.computeFaceNormals();

let mesh= new THREE.Mesh( geom, new THREE.MeshNormalMaterial() );
Posted by: Guest on October-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language