I am trying to make the autodesk viewer display files in orthographic mode by default. So far the best solution i've come up with is the following:
forgeViewer.addEventListener(
Autodesk.Viewing.GEOMETRY_LOADED_EVENT,
function setOrtho() {
forgeViewer.autocam.homeVector.isPerspective = false;
forgeViewer.autocam.homeVector.isOrtho = true;
forgeViewer.autocam.originalHomeVector.isPerspective = false;
forgeViewer.autocam.originalHomeVector.isOrtho = true;
forgeViewer.autocam.toOrthographic();
},
);
This sets home to orthographic and sets the current view to orthographic which is exactly what i'm looking for. The only issue i have is that waiting on the GEOMETRY_LOADED_EVENT
means that larger models will load in perspective and then snap to orthographic when all of the geometry is loaded, which can be jarring for users.
Is there a way to get the viewer to initialize in orthographic sooner so that it doesn't do this? I've tried waiting on a few other events as well as running setOrtho
immediately with no event listener and usually it fails to get picked up.