Bug: Zooming of tileset when updating camera view using setView and switching the frustum to Orthographic

Hello everyone!

I am having zoom issue whenever I set the camera view to a specific destination & orientation then switching it to orthographic frustum.

Here is the code that I used which causes the zoom issue that I am encountering.
First: I set the camera view using the code below:

                           viewer.camera.setView({
                                    destination: position,
                                    orientation: {
                                        direction: direction,
                                        up: up
                                    }
                                }
                            );

Second: I switch the camera projection using the code below:

                           viewer.camera.switchToOrthographicFrustum()

Third: After zooming in once, I cannot zoom in/out anymore as shown in the gif below
chrome-capture-2023-2-20 (1)

Do you have any idea on how to fix the zoom issue in this case?

Hi Sarah,

I think I’m having difficulty replicating the issue.

For example I’ve added viewer.camera.switchToOrthographicFrustum to our 3D Tile Picking example after the view has been set in a similar way.

Is it possible to provide a minimal Sandcastle example replicating the issue with your data?

Thanks!
Gabby

1 Like

Hi Gabby,

Thank you so much for the reply. I was able to replicate the zoom issue in my sandcastle example. There were also times where I can’t zoom-in anymore and then when I zoom-out again I could zoom-in.

Here is the sandcastle link.

Thanks,
Sarah

Thanks for the example Sarah!

I see this when running your example, is that correct?

I think I may see better behavior if I set

viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;

but I’m not sure entirely.

1 Like

Thanks for the reply Gabby!

Yes, that is correct.

I tried adding the viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; but it is still the same.

Here is the behavior that I am currently experiencing.

chrome-capture-2023-2-31

Thanks Sarah,

I believe this was a bug, and I opened a quick fix in this PR. At this point we’ve begun today’s release already, so I’d expect this change to go out with the May 1 release.

1 Like