Search code examples
autodesk-forgeforge

How to set all properties for viewer.getCamera() in Autodesk Forge


I use the markup extension for Autodesk forge. When i want to show markups with separate layers, i get camera positions and rotate model with that position. But when i move model in show mode and after when i want to see another markup layer, the model positions changes. How can i fix this problem.


Solution

  • Please use const viewState = viewer.getState({ viewport: true }) to capture current camera statue instead, and restore it via viewer.restoreState( viewState )