Hello Everyone,
It is my first post on the forum, but I am a frequent lurker and found a lot of solutions to problems I have encountered at work.
I am facing a problem relating to translation of the views from Free Camera to ArcRotate Camera. In a nutshell, I would like to mutate the arcRotateCamera to replicate the view of an exported Free Camera.
For example, I have a scene with two models. The view from the default arcRotateCamera is shown in image1 attached to this post.
In the glb file, I also have two Free Cameras.The first looks at one model:
While the other has both models in its viewport:
In order to replicate the view from FreeCamera in the arcRotateCamera, I perform the following steps by mutating the arcRotateCamera:
a) Position the arcRotateCamera in the location of the Free Camera (i.e. attaching to its parent mesh)
b) Set the target as the middle of the model (setTarget)
c) Update the alpha and beta as well as upVector
When I am performing these actions on the scene with single model, I am able to achieve the desired results.
However, once the scene contains more than one model, the derived alpha and beta of my arcRotateCamera becoming slightly incorrect.
My gut tells me this might me related to the fact that the worldExtends of the scene with single model are different than in a scene with multiple models.
I would like to provide a playground, but my model files are quite big and there is a lot of custom code, what makes it difficult to replicate.
I was wondering whether anyone has encountered similar issues before or had any suggestions how this task could be approached differently?
Any ideas are highly appreciated!