Gizmo issue with two viewports and GUI

I’d appreciate any thoughts as to why the gizmo appears in the middle of the screen (the guiCam area), when it should appear attached to the cube in the bottom viewport:

Commenting ‘scene.activeCameras.push(guiCam)’ out makes the gizmo appear in the right place, but the GUI button disappears.


You need to setup the camera you would like to render the gizmo in with: gizmoManager.utilityLayer.setRenderCamera(camera1);

But it looks like we might have an issue handling viewport correctly as it behaves like no viewport would have been set.

@Cedric would you mind having a look into it ?

Thanks @sebavan. I’ve added ‘gizmoManager.utilityLayer.setRenderCamera(camera2)’ but I still can’t see the gizmo.

Correction: I refreshed my browser, and now I can see the gizmo - it doesn’t response to mouse input though.

Yup this is the part I asked Cedric to double check :slight_smile:

Thanks :slight_smile:

I think I see what’s going on…let me investigate more.

PR is live : Use Layer render camera for Scene ray picking by CedricGuillemet · Pull Request #10646 · BabylonJS/Babylon.js · GitHub
it will use camera provided by gizmoManager.utilityLayer.setRenderCamera for scene ray picking instead of scene.activeCamera

1 Like

@Cedric Thanks for sorting this out.

I’m new to BJS, so presumably ‘PR is live’ means the source has been updated and the changes will visible in the PG when I refresh my browser?

The gizmo appears correctly now, but I can’t click on the tranform or rotate elements - what am I doing wrong?

No, it means the PR is available for review and the corresponding branch can be checked out for review.
It needs to be merged in master branch and released as an NPM before you can use the package.

Thanks for clarifying. If I understand correctly (I’m new to source control), @sabavan has now approved the commit to BabylonJS:master? I’m working in VSCode, and not sure what to do with the updated branch when I download it…

@Cedric Please can I check: is the second issue I mentioned with the translate and rotation gizmo elements not working now also fixed as part of your mod this morning?

Gizmo not showing at the right place is fixed by adding gizmoManager.utilityLayer.setRenderCamera and manipulation is fixed with the PR.

1 Like

@Cedric you rock

1 Like

@Cedric Thank you very much to you, @sebavan, and the team for such a fast turnaround - from bug report to public release in 1/2 a day is amazing! I’m truely impressed by the professionalism of the BJS team, and this gives me confidence in choosing BJS as a potential solution for a new commercial project I’m working on.