0

我在 glTF 中以 threejs 加载的网格上出现了一些奇怪的黑点。以前有人遇到过这个问题吗?

网格重 145 663 个顶点,最大部分有 89 000 个顶点

我正在使用threejs的r94版本,并使用以下代码加载网格:

`

function setup(scene, camera, renderer) {
    var loader = new THREE.GLTFLoader();
    THREE.DRACOLoader.setDecoderPath( 'js/libs/draco/gltf/' );
    loader.setDRACOLoader( new THREE.DRACOLoader() );

    // Load a glTF resource
    loader.load(
        // resource URL
        'mesh/ExportAllcleanNoMap.glb',
        // called when the resource is loaded
        function ( gltf ) {

            gltf.scene.scale.set(10,10,10);
            scene.add( gltf.scene );
            var anim = gltf.animations[0];

            mixer = new THREE.AnimationMixer( gltf.scene );

            var action = mixer.clipAction(anim);
            action.play();

            orbitControls = new THREE.OrbitControls( camera, renderer.domElement );
            orbitControls.target.set( 0, 1, 0 );
            orbitControls.update();

            light = new THREE.HemisphereLight( 0xbbbbff, 0x444422, 2 );
            light.position.set( 0, 1, 0 );
            scene.add( light );

            scene.add(light);
            var ambient = new THREE.AmbientLight( 0x222222 );
            scene.add( ambient );
        },
        // called while loading is progressing
        function ( xhr ) {

            console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );

        },
        // called when loading has errors
        function ( error ) {
            console.log(error);
            console.log( 'An error happened' );

        }
    );
}
`

谢谢。

编辑:禁用 draco 压缩时不会出现黑点。看起来像是threejs、draco 和heavy mesh 之间的问题。

网布上的黑点
网布上的黑点

4

1 回答 1

0

这看起来像双倍几何。你不知何故有两个模型的副本完美地重叠在一起。

通过选择一个对象的顶点并移动它们来检查您的建模软件,看看它们后面是否有重复。

如果您使用的是搅拌机,您可以在编辑模式下选择受影响区域中的单个顶点,然后按 ctrl L 选择链接的顶点...然后将它们移到一边,看看是否有几何图形隐藏在它们后面。

于 2018-07-04T22:42:55.253 回答