If I want to only be able to scale a plane mesh uniformly (keep aspect ratio), is there a way to disable the handles on the sides of the plane that let it be scaled in one axis only?
cc @cedric
You can disable scaling axis with axisFactor
gizmo.axisFactor = new BABYLON.Vector3(1,0,0);
will disable axis that is not touched by X
Thanks. I wondered what axisFactor was but couldnāt find it documented anywhere.
Sorry, I realize my original question was misleading. If I disable x and y, then I canāt scale at all. But if I enable only x, then I can scale non-unifomrly in x which isnāt what I want. Iād like to have corner affordances only, but still be able to scale uniformly in xy.
You can also tweak the scaling values with an observable like this:
gizmo.onScaleBoxDragObservable.add(() => {
mesh.scaling.y = mesh.scaling.x;
mesh.scaling.z = mesh.scaling.x;
});
That would just set the y scale and z scale to be the same as the x. I want the same aspect ratio, e.g. 8 x 6. I just want to hide or disable the scaling handles along the top and sides of the plane and only have scaling handles on the corner since those handles preserve aspect ratio.
We are feature locked until 5.0 release but Iāve found a workaround by disable boxes you donāt need:
Hello @ericwood73 just checking in if your question has been answered
Yes. Sorry I forgot to mark the solution.
Hey! Thanks for this suggestion, it really works. I was just wondering if it couldnāt be exposed through public BoundingBoxGizmo properties as I almost put the same question on the forum because I didnāt find the solution on the docs
Just a question. For the rest itās amazing