GizmoBoundingBox - Is it possible to have a scaleBox/drag point on edges like SketchUp?

Hi everyone,

Like the title say, is it possible to have a drag point (scaleBox) on edges of the BoundingBox gizmo like SketchUp ?
Currently we can have scaleBoxes to the corners and it makes a scale on the 3 axes at the same time, I want to make a scale on 2 axes and not 3.

2023-02-13_12h08_00

Here a PG of a pre work that i’ve done :

Adding @Cedric the mastermind behind Gizmos

If I understand correctly, it would replace the rotation spheres on the edges with a 2D-like scale.
I see no objection to that. It needs a new optional property that is set at construction time to set that behavior (disabled by default to preserve the backward compatibility).
I’ll be happy to review your pull request :slight_smile:

This is the approach I use:

oops! look now,

Use another ‘shadow’ mesh and have the onDrag callbacks on the main mesh ‘chase’ the scaling on the ‘shadow’.

Hi,

Thanks for your answer, it looks very cool.

Does someone have an idea to make the corners scaleBoxes not proprotional ? i mean that by draging a corner scaleBox i can scale on the x axe more than the y axe.

2023-02-16_11h10_14

@Cedric any ideas?

I can’t think of any way other than building control from scratch using pointer drag behaviors. Something like this:

You still need to add the other axes and move target so opposite edge is stationary.

Hope that’s helpful!

Flex

2 possibilities:

  • start a new control from scratch
  • add properties/flags to BoundingBoxGizmo to support this new behavior.

I’m in favor of #2 because of the work and copy/paste #1 needs (snapping, rotation on/off,…). where as, just adding a flag seems easy. Same for documentation, just 1 flag to explain Vs adding a whole new page.

It looks like the proportional computation is here :

Tried that out. Works great. I think the flag needs to be in the constructor because getting the scale boxes all synced up after the gizmo has been constructed looks like a big butt-pain. I can share a branch or the file if that would be helpful.

I also added a flag that allow you to have parent meshes with non-uniform scaling at your own peril.

The modified file is attached.
boundingBoxGizmo.zip (6.4 KB)