我在glTF的一个网格上看到了一些奇怪的黑点。以前有没有人已经有过这样的问题?
网格有145663个顶点,最大的部分有89000个顶点。
我使用的是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压缩时不会出现黑点。看起来像是3ejs,draco和heavy mesh之间的问题。
网格上的黑斑

发布于 2018-07-05 06:42:55
这看起来像是加倍的几何体。不知何故,你有两个模型的副本完美地叠加在一起。
通过选择一个对象的顶点并移动它们来检入您的建模软件,并查看它们后面是否隐藏着重复的顶点。
如果您正在使用blender,您可以在编辑模式下选择受影响区域中的单个顶点,然后执行ctrl L来选择链接的顶点...然后将它们移到一边,看看是否有几何体隐藏在它们后面。
https://stackoverflow.com/questions/51177791
复制相似问题