Hi everyone,
I’m struggling on something for days. I imported a glb file (a room) then created HolographicButton and Button3D, but these buttons are always on top, even when I move to an other room, I see the buttons through the wall and can click them (which I don’t want).
Here is my code:
const manager = new GUI.GUI3DManager(this.scene)
const panel = new GUI.StackPanel3D(true)
panel.useBitmapCache=true
panel.margin = 0.02
panel.blockLayout = true;
manager.addControl(panel)
// --button//--
const button = new GUI.HolographicButton("Btn")
button.useBitmapCache=true
panel.addControl(button)
const btnText = new GUI.TextBlock()
btnText.text = "Click me"
button.content = btnText
// --title//--
const title = new GUI.Button3D("Title")
panel.addControl(title)
const titleText = new GUI.TextBlock()
titleText.text = "I am a 3D title"
title.content = titleText
title.mesh.isPickable = false
panel.blockLayout = false;
Been there, saw that
You may want to give a look at my topic (kindly solved by @sebavan)
Sidenote: Since the solution adds lot of drawcalls, I ended-up building it differently. I’m now hiding the 3D GUI when the interaction is over (actually when moving away from the interaction area).
Forgot to mention (if you have no post) then it’s likely you are not choosing the right approach and not actually accessing the manager layer.
To access the manager layer you need to go something like:
manager.utilityLayer.setRenderCamera(camera2);
And then since the manager (utility layer) IS a separate layer drawn on top of everything, changing the rendering group id outside this layer will have no effect. So, I use a multicam approach with layerMasks.
@carolhmj I was trying to find a solution to use playground ('cause my model is private ).
But as @mawa said, when I remove the post, everything work perfectly.