如何将 three.js 相机转换为 Revit ViewOrientation3D?

How can I convert a three.js camera to a Revit ViewOrientation3D?

我一直在尝试从 three.js 相机获取位置、方向和向上矢量,并将其应用于 Revit 中的 ViewOrientation3D。我 运行 遇到设置方向抛出此异常的问题。

Exception thrown: 'Autodesk.Revit.Exceptions.ArgumentsInconsistentException' in RevitAPI.dll

ViewOrientation3D 文档说当“向量 upDirection 和 forwardDirection 不垂直”时会抛出此异常。我需要使用 three.js 相机的哪些参数?

ViewOrientation3D orientation = new ViewOrientation3D(threePosition, threeUp, threeDirection);
view.SetOrientation(orientation);

如有任何建议,我们将不胜感激!

我相信您的问题已由 The Building Coder 完整回答,例如,讨论如何 Map Forge Viewer Camera Settings back to Revit and Serialising 3D View Camera Settings。请确认并分享一个代码片段,显示您最终如何使用它来解决您的问题。谢谢!