How to custom boundingBoxGizmo scale box

current:

image

change to:

image

and when I set material to scale box, it change to black.

        const scaleBoxMat = new BABYLON.StandardMaterial("scaleBoxMat", scene);
        scaleBoxMat.diffuseColor = BABYLON.Color3.Red();
        boxes.forEach((b: any, i: number) => {
            b.material = scaleBoxMat;
        });

image

You should use emissiveColor instead of diffuseColor as there are no lights within the utility layer scene for the boundingBoxGizmo.

I would also suggest to disableLighting in this case.

Your method can change the initial color, but it changes back to the original blue after the mouse hovers.

BoundingBoxGizmo has a coloredMaterial and hoverMaterial attributes. but these apply to both scaleBoxes and rotationSpheres

else, as far as I know, the BoundingBoxGizmo doesn’t support setting custom meshes.
https://doc.babylonjs.com/typedoc/classes/BABYLON.BoundingBoxGizmo#setCustomMesh