【问题标题】:How to get the x and y of canvas coordinates from a x,y,z point in the viewer. Is required for CustomToolTip of the Data Visualization extension如何从查看器中的 x,y,z 点获取画布坐标的 x 和 y。数据可视化扩展的 CustomToolTip 需要
【发布时间】:2021-09-06 19:58:53
【问题描述】:

我试图从数据可视化扩展中将 CustomToolTip 放到 Sprite 中。在文档中,它显示了多个类似link 的示例,但我没有找到他们用来获取它的代码,或使用此功能的任何其他代码示例。该文档对于查找如何获取 x 和 y 坐标也没有太大帮助。

这个想法是为 Sprite 添加一个带有标题和描述的 CustomToolTip

【问题讨论】:

    标签: autodesk-forge autodesk-viewer


    【解决方案1】:

    我已经找到了获取 x 和 y 坐标的方法。

    viewer.worldToClient(new THREE.Vector3( x, y, z )) 其中 x,y,z 是您要转换为画布 2d 坐标的 3d 坐标。它将返回一个 THREE.Vector3 对象,其中 z 的值为 0,x,y 的值为所需的值

    【讨论】:

      猜你喜欢
      • 2022-11-13
      • 2019-02-17
      • 2014-12-02
      • 2019-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-10
      • 2021-12-24
      相关资源
      最近更新 更多