Gizmo customization - limit behavior (stop moving position) and customizing the pull features (make spheres bigger)

I’m using a gizmo and having trouble limiting some behavior (stop moving position) and customizing the pull features (make spheres bigger).

My PG is here. Below is what I want to accomplish.

I want the gizmo to:

  1. scale on corners / faces of gizmo ONLY no change in position on drag or rotate
  2. increase / control size of pull tab spheres - with large geometry I can’t see pull tab / spheres.

I believe I have eliminated rotation with “gizmoManager.rotateDraggedObject = false” but can’t seem to stop dragging position even with false draggableMeshes, disableMovement, etc. Do I have to change the onPositionObservables? I can’t seem to find a built in method.

Adding @Cedric

You can use scaleBoxSize to make the scaling controls bigger and use boundingBoxDragBehavior to disable dragging. And setEnabledRotationAxis("") disables rotation completely, thou IDK if it’s the best way to do it. :slightly_smiling_face:

Hi @twinturbotom

I’m not sure to understand what you want. Do you want to use a bounding box gizmo with anchors to roate and scale the mesh?
scaling a mesh with a bounding box gizmo will always change its position unless the mesh pivot is on the opposite side of the scale.

to change the size of the rotation sphere, use this : BoundingBoxGizmo | Babylon.js Documentation

This will give you something like in your code:

gizmoManager.gizmos.boundingBoxGizmo.rotationSphereSize = 100;

@Blake got it & @Cedric had some good info for me.

Thanks for helping out here. I was close on the drag but couldn’t quite get it all.

1 Like

Although the scaleBoxSize and rotationSphereSize aren’t working in my app outside of PG… I’ll hunt that down now. If there is a something common let me know.


Okay so tt seems that setting the boundingBoxDragBehavor=false throws the error below. This achieves the behavior (not dragging position - but I’m not a fan of throwing the error).

Uncaught TypeError: e.init is not a function

1 Like

The error occurs on the PG with version 4.2.0 as well but works without error on the latest version.

EDIT: scratch that, it occurs on both versions, but not until the mesh is clicked…

I’m using the cdn version for my app → I’ll look into upgrading to the latest.

I still see the error in PG 5.


1 Like

Oh I see now, you have to click the mesh to produce the error. EDIT: setting disableMovement works better to disable the dragging behavior .