我成功地使用 THREE.js 从平面构建了一个卷堆栈,但是一旦平面与观察平面正交(逻辑上),它们就会隐藏起来。我怎样才能避免这种情况;切片如何视图对齐?JSFiddle在这里
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 45, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 1000 );
camera.position.x = 0;
camera.position.y = 20;
camera.position.z = 1000;
//camera.rotation.x = 45 * (Math.PI / 180);
scene.add( camera );
geometry = new THREE.PlaneGeometry(640, 352);
for ( var i = 34; i <= 511; i ++ ) {
var texture = THREE.ImageUtils.loadTexture( 'bodyslice/' + i + '.jpg' );
console.info(texture);
texture.magFilter = THREE.NearestFilter;
texture.minFilter = THREE.NearestFilter;
var material = new THREE.MeshBasicMaterial( { map: texture, opacity: 0.05, transparent: true, depthTest: false} );
var plane = new THREE.Mesh(geometry, material);
plane.position.y = 300 - i;
plane.rotation.x = 90 * Math.PI / 180;
plane.doubleSided = true;
scene.add( plane );
}
renderer = new THREE.WebGLRenderer({ antialias: false });
renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
container.appendChild(renderer.domElement);
}