THREE.js - Graphical Glitch with an imported model

六月ゝ 毕业季﹏ 提交于 2020-01-05 06:43:11

问题


I'm experiencing a graphical glitch with an imported model while using JSONLoader. I can't really explain it, you'll have to see it.
It may have something to do with the different materials and the camera POV.

You can find the plunk here:
http://plnkr.co/edit/0VjHiGNmWFHxdoMWC3GV?p=info

JSONLoader part of the code:

var loader = new THREE.JSONLoader();
loader.load( 'tv.js',
        function ( geometry, materials ) {
        var tv = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials) );
        glScene.add(tv);
} );

a screenshot of the glitch


回答1:


The "glitch" you are referring to is due to z-fighting.

Your camera near plane is 0.01 and far plane is 20000. Small values of the near plane can lead to depth-sorting precision problems.

In your case, set your near plane to, 1 or 10.

ref: http://www.opengl.org/wiki/Depth_Buffer_Precision.

three.js r.81



来源:https://stackoverflow.com/questions/40171817/three-js-graphical-glitch-with-an-imported-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!