【发布时间】:2020-11-11 21:07:42
【问题描述】:
当光标悬停在 3d 模型上时,我尝试显示捕捉图标(一些黄色图标与光标一起出现在进行测量时)。这是我的功能,它根本不适合我。我错过了什么吗?
onMouseMove = (event) => {
const snapper = new Autodesk.Viewing.Extensions.Snapping.Snapper(this.viewer);
const worldCoordinate = this.viewer.impl.hitTest(event.clientX, event.clientY);
if (worldCoordinate === null) return;
const hitTestResult = this.viewer.impl.snappingHitTest(
worldCoordinate.x,
worldCoordinate.y,
worldCoordinate.z
);
if (hitTestResult === null) return;
snapper.snapping3D(hitTestResult);
const result = snapper.getSnapResult();
}
我也参考了其中一些主题,但不适用于我。 How to use Forge Viewer Snapper? How to activate Autodesk Forge Snapper? https://autodeskviewer.com/viewers/latest/docs/extensions_Measure_Measure.js.html .提前致谢!
【问题讨论】:
标签: autodesk-forge autodesk-viewer