2017-04-25 33 views
0

我在瀏覽器中用three.js顯示鞋子模型。當我將腳後跟設置爲半透明材質時,出現問題。我已經在項目中使用了orbitControls,當我旋轉到某個角度時,半透明材質顯示黑斑和三角形?如何消除透明材料中的黑暗區域?

enter image description here

我希望它看起來像這樣:

我怎樣才能改變材料性能的材料設置爲一個純粹的顏色?我已經設置了這樣的材質道具

new THREE.MeshPhongMaterial({ 
    color: 0xff0000, 
    specular: materialParams.material3d.specular, 
    shininess: materialParams.material3d.shininess, 
    transparent: true, 
    opacity: materialParams.material3d.opacity,  
    map: that.textureLoader.load(this.sourceUrl + 
    materialParams.material3d.icon), 
    side: THREE.DoubleSide, 
    blending: THREE["NormalBlending"] 

}) 
+0

檢查本文[這裏](https://aboosbox.wordpress.com/2017/04/17/three-js-for-absolute-beginners/)您可能得到解決! –

+0

請顯示您正在談論的那個黑點的截圖。 – hidefromkgb

+0

謝謝,我上傳了一個錯誤的shotScreen ...,現在我再次在開始鏈接上載它 – feixiangsnail

回答

0

半透明面以它們在緩衝區中出現的順序呈現。這會導致半透明材料中的僞像或「黑點」。

由於您的「腳跟」的幾何形狀似乎是凸的,一個簡單的辦法可能是令人滿意的是使只有前表面:

mesh.material.side = THREE.FrontSide; 

當材料是透明的,幾何形狀是更復雜的,您可能需要嘗試其他解決方案。 this answer解釋了一種替代方法;

three.js所r.85

+0

請你能幫助我[這個問題](http://stackoverflow.com/questions/43693337/modify-three-js-pointerlock-controls-example-to-make-it-fly)? – neoDev

相關問題