Setting Perspective Camera before model is loaded

We have “BIM-mode” on our models, and would like to use “Perspective” as default camera projection on 3D models (like IFC and Revit).

But we are only able to set “Perspective” after the model is loaded.

So first the model is loaded with camera projection “Orthographic” , and then it is visually changed to “Perspective” in the viewer.

We’ve tried setting this
this.viewer.getView(0).setProjectionMode(Communicator.Projection.Perspective);
in different viewer callbacks, but have not been able to make it work as a default setting before the modelStructureReady callback.

Any idea on how to do this as default camera projection before loading the model?

I’ve looked as the description here to see if it could help:

I thought I fixed it using this approach, but I still get a “jump” between Orthographic and Perspective projection.
It is almost invisible on small models, but quite annoying on larger model.

Hello @slinkire,

Perhaps we can leverage the paired functions pauseRendering/resumeRendering to better time the camera projection switch, for example:

viewer.setCallbacks({
      sceneReady: function() {
        viewer.view.setBackgroundColor(Color.white(), Color.white());
		viewer.pauseRendering();
      },
	  modelStructureReady: function() {
		let cam = viewer.view.getCamera();
		cam.setProjection(Communicator.Projection.Perspective);
		viewer.view.setCamera(cam);  
		viewer.resumeRendering();
	  }
    });

So basically, rendering is paused on sceneReady and resumed once the camera projection has been set to perspective in modelStructureReady.

Thanks,
Tino