Three.js SubdivisionModifier“computeEdgeFaces”错误

时间:2014-01-03 02:54:09

标签: three.js

我正在使用SubdivisionModifier进行一个项目,但我在firefox控制台中遇到了这个错误:

“TypeError:computeEdgeFaces不是函数”

我该如何解决?

这是我的创建场景代码:

   function createScene(geometry, scale, material) {

     var modifier = new THREE.SubdivisionModifier(3);

     geometry.mergeVertices();
     geometry.computeCentroids();
     geometry.computeFaceNormals();
     geometry.computeVertexNormals();

     modifier.modify(geometry);

     mesh = new THREE.Mesh(geometry, material);

     mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;

     scene.add(mesh);
   }

这是整个代码:http://jsfiddle.net/user972611/yYRP5/

感谢。

Three.js R64

1 个答案:

答案 0 :(得分:0)

HA,我得到了这段代码:

   function createScene( geometry, scale, material ) {

    geometry.mergeVertices();

    var modifier = new THREE.SubdivisionModifier(2);
        modifier.modify(geometry); 

    geometry.computeFaceNormals();
    geometry.computeVertexNormals();
    geometry.computeTangents();

    mesh = new THREE.Mesh( geometry, material );