【问题标题】:Stop Custom Image from rotating停止自定义图像旋转
【发布时间】:2026-01-28 20:55:01
【问题描述】:

我们正在使用 Forge 查看器来显示 Revit 文件。我们想显示一个自定义图像作为背景。我们尝试了不同的选择。但是,图像正在旋转,我们不希望自定义图像旋转。是否可以使用代码将自定义图像添加到环境并避免旋转?我们还尝试使用 three.js 网格。它显示图像,但图像正在旋转。我们可以做些什么来避免自定义图像旋转?

感谢您的帮助。

以下是我们使用 Mesh 的示例代码。它显示图像,但它会旋转。

const imgTexture = THREE.ImageUtils.loadTexture('images/bsd-speclink-logo.jpg')
var transparentMaterial = new THREE.MeshBasicMaterial({

     map: imgTexture,

    color: 0xffffff,
    opacity: 0.1,
    transparent: true
   })

    viewer.impl.matman().addMaterial('transparent',transparentMaterial,true)
    var geometry = new THREE.PlaneGeometry(50, 40, 40, 40);
    var mesh = new THREE.Mesh(geometry, transparentMaterial)
    mesh.position.set(60, -60, 0);
    viewer.impl.scene.add(mesh)
    viewer.impl.invalidate(true)

【问题讨论】:

    标签: autodesk-forge


    【解决方案1】:

    请参阅这篇博文 here 将画布设置为透明,以便您可以滑入下方的背景。

    或者尝试使用天空盒解决方法here 来模拟画布中的背景。

    【讨论】: