4
  • 有一个有墙壁和地板的 3d 迷宫。
  • 有一个带键的图像(或其他不重要的对象,但它们都是图像而不是 3d 模型)。

我想将它显示在地板上,如果相机在对象周围移动,则需要在不旋转对象的情况下看起来相同。我怎样才能做到这一点?

更新1:

我创建了一个平面几何图形,添加了图像(它是一个透明的 png)并在渲染时旋转。它工作得很好,但如果我转动相机,有时飞机会失去透明度大约几毫秒,并得到纯黑色背景(闪烁)。

知道为什么吗?

这是代码:

var texture = new THREE.ImageUtils.loadTexture('assets/images/sign.png');
var material = new THREE.MeshBasicMaterial( {map: texture, transparent: true} );

plane = new THREE.Mesh(new THREE.PlaneGeometry(115, 115,1,1), material );
plane.position.set(500, 0, 1500);
scene.add(plane);

// at render:
plane.rotation.copy( camera.rotation );
4

1 回答 1

2

这将通过使用来实现:

function animate() {
     not3dObject.rotation.z = camera.rotation.z;
     not3dObject.rotation.x = camera.rotation.x;
     not3dObject.rotation.y = camera.rotation.y;
     ...
     render();
}
于 2012-11-26T20:04:46.270 回答