📜  用threejs制作三角形 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:18.260000             🧑  作者: Mango

代码示例1
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() );