0

I want to show X,Y,Z axes in forge viewer at the bottom-left corner like Navisworks. I can create the axes lines (described here) in a certain position of the viewer. But, as expected, whenever I navigate to somewhere the axes also moves. I want it to be placed at the bottom-left corner every time and syncing with the viewer X,Y,Z axes. The Navisworks axes in HUD is like below -

enter image description here

Please share some good idea!

Md. Shohag Mia
  • 322
  • 3
  • 13

1 Answers1

2

Forge Viewer doesn't offer this feature out-of-the-box but it should be pretty straightforward to implement something similar yourself.

I'd recommend using the approach used by the viewer's "view cube" (in the top-right corner). That cube is actually rendered in its own <canvas> element, and overlaid on top of the viewer canvas. You could create your own <canvas> element in the bottom-right corner, use standard three.js (specifically version 71 that's included in Forge Viewer) to render your axes there, and update their orientation based on the viewer's Autodesk.Viewing.CAMERA_CHANGE_EVENT.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24