3

我正在尝试获取导入的 obj 的所有顶点。这是我的代码:

// model
var loader = new THREE.OBJLoader( manager );
loader.load( 'tagliatella.obj', function ( object ) {

    object.traverse( function ( child ) {
        if ( child.geometry !== undefined ) {

            console.log( child.geometry.vertices );

            for(i=0;i<child.geometry.length;i++){
                var point =child.geometry.vertices[i];
                //  console.log ( point );
            }
        }
    }
    );
    obj = object
    scene.add( obj );
4

0 回答 0