In the inspector when we want to display a gizmo, it does not work correctly when there are several cameras.
In fact, it takes the last camera and the scene displays the first camera well. so we never see the gizmo on the camera[0]
Wouldn’t it be possible to define the active camera for the inspector’s gizmos? An options in :
scene.debugLayer.show({activeCamera: camera[0]});
Afterwards, yes we can modify the order of the cameras in activeCameras, but my cameras are already in an order that suits me. Changing the order would break everything. The ideal would be to be able to choose the camera that the gizmo of the inspector uses. On my scene, the camera{0] is used.
Besides, the scene uses the first active camera, it would be logical for the inspector to do the same.
Did I miss something otherwise, an option that I would not have seen?
I can’t choose only one camera when we have several :
scene.activeCameras = [camera0, camera1, camera2, cameragui];
here it is cameragui which is taken into account for the gizmo of the inspector, but for the scene it is indeed camera0
This does nothing : scene.activeCamera = scene.activeCameras[0];
What I would like is for the gizmos to take into account the first camera (camera[0]) and not the last (camera[4]) Or maybe an additional option in show(activveCamera: cameras[0])
Hi,
Hope you are well. I sort of remember you had (a base of) a PG for this including the gizmo, correct?
But I can’t find it just now? Would you mind posting it here so we can have a closer look. Sry, I’m such a lazy person, I don’t feel like adding the gizmo to the scene? No, in truth, if I recall correctly you also had a number of viewports and some specific behavior of the camera depending on context (or is it another project?)
Edit: Sry in advance, created some ‘shit’ in this PG before finding what I was looking for. In truth, I’m not a specialist of gizmos But I think what you are looking for is ’ UtilityLayerRenderer’
Quite simple in fact, once you know where to look Line 47 in this ‘dirty’ PG (again apologies for that). Hope this helps anyways and have a great day
Edit1: Of course it works with the gizmo manager as well, you just need to instruct on the utility layer to not use the default rendering
I may have expressed myself badly. I’m talking about the inspector’s gizmo. You don’t need to add one.
The Gizmo inspector’s does not work with several cameras. it takes into account the last camera only.
use the gizmo available in the inspector, but we cannot define which camera the inspector uses. The scene takes camera[0] but the inspector takes the last active camera and not the first.
Here is a picture of the Gizmos I’m talking about.
Indeed. I completely misunderstood this. My apologies.
Now that you explain it, actually you are right and I noticed this before.
I could deal without it but I can understand that depending on project it can be annoying.
Though I have no idea what sort of effort it would require to implement/fix this.
May be you should edit the category of your post which is not really a question, in my opinion.
Rather a ‘bug’ or ‘feature request’?
Yes it’s true, I hesitated to post in bug, I thought maybe there was something I had missed.
I can’t move my post. Maybe someone on the team can do it.
activeCameras is used when in multi camera mode and will normally superseed activeCamera.
But to “simplify” the process I think that during the render phase, in scene, the current activeCamera is swap in a foreach loop by one of the activeCameras.
It should help specifying the Camera you want for gizmo with this: https://www.babylonjs-playground.com/#XQ729G#3 as some setup like choosing one of the middle camera would never be possible otherwise.
Please note, the playground will only work after the next nightly.