I’m trying to get an invisible custom rotation gizmo on an object that is sized to encompass the object’s bounding sphere.
Here it’s working on the utility layer but I’m unsure how to dynamically update the gizmo proxy mesh diameter to match the object’s bounding sphere in screen space: https://www.babylonjs-playground.com/#A4RME3#6
I tried to place gizmo in main scene but it didn’t work: https://www.babylonjs-playground.com/#A4RME3#7
Results in error: When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)
Having the gizmo in the main scene rather than an overlay would be preferable in my use case as I’m likely to have other clickable 3D objects between the rotatable object and the camera/utility layer i.e. I don’t want the rotation gizmo proxy to block other clickable objects in the main scene.
I think you have to use the same layer that’s used for rendering the meshes.
I couldnt find anything in the documentation.
Maybe @sebavan knows how to find the layer for solid meshes?
The meshes are actually straight on the scene and not on a special layer. The gizmos are always rendered in a utility layer at the moment but you could inspire from their code maybe ?
Hi @Cedric. Although working in the PG I’m getting a “Property ‘updateScale’ does not exist on type ‘PlaneRotationGizmo’” tsc error. scaleRatio works fine. I’m using the latest npm package 4.0.3.