THREE.JS创建具有3个以上顶点的面

时间:2018-04-06 11:08:38

标签: three.js face

我有一个代码:

var geometry = new THREE.Geometry(); 

    camera.position.set(1500, -1300, 1500);

    var vertex = [ 
        new THREE.Vector3(1000, 0, 1000),
        new THREE.Vector3(2000, 0, 1000),
        new THREE.Vector3(2000, 0, 2000)
    ];
    geometry.vertices = vertex;
    var faces = [ new THREE.Face3(0, 1, 2) ];
    geometry.faces = faces;

    var Material = new THREE.MeshBasicMaterial( { color: 'blue'} );
    var object = new THREE.Mesh( geometry, Material );
    scene.add(object); 

结果是:

enter image description here

我想在我的脸上有更多的顶点。可能吗? 当我尝试时:

var vertex = [ 
    new THREE.Vector3(1000, 0, 1000),
    new THREE.Vector3(2000, 0, 1000),
    new THREE.Vector3(2000, 0, 2000),
    new THREE.Vector3(2000, 0, 1000)
];

......它不起作用:(

0 个答案:

没有答案