我知道我的 JSON 模型中的每种材料都有两种设置:depthTest
和depthWrite
.
我将它们设置为false
,因为某些材质具有 RGBA 纹理图像,并且所有 alpha 通道都具有与背景相同的颜色。
现在纹理具有类似于z-index
将它们置于上方或下方的值。
我该如何解决?
编辑:
这是页面:http: //xalien95.altervista.org/pkmnxy_engine/alisopoli.html
这是代码:
var camera, scene, renderer, mesh, loader;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 1000;
scene = new THREE.Scene();
loader = new THREE.JSONLoader();
loader.load( "alisopoli/alisopoli.js", function( geometry, materials ) {
for ( var i = 0; i < materials.length; i ++ ) {
materials[ i ].side = THREE.DoubleSide
//materials[ i ].overdraw = true;
}
//var faceMaterials = new THREE.MeshFaceMaterial( materials );
//faceMaterials.map.magFilter = THREE.NearestFilter;
//mesh = new THREE.Mesh( geometry, faceMaterials );
mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
mesh.scale.set( 100, 100, 100 );
mesh.rotation.x = 45 * Math.PI / 180;
scene.add( mesh );
} );
var ambientLight = new THREE.AmbientLight(0xFFFFFF);
scene.add(ambientLight);
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
}
function animate() {
requestAnimationFrame( animate );
mesh.rotation.y += 0.005;
renderer.render( scene, camera );
}
这是模型:http: //xalien95.altervista.org/pkmnxy_engine/alisopoli/alisopoli.js