Re-position or re-scale a cube using positions of other meshes


In the following playground, I have a cube and spheres positioned on 4 corners of that cube:

These spheres are supposed to work as size controllers of the cube as illustrated in the following video:


My code works for an un-rotated cube as in the video, but doesn’t quite work with a rotated cube (in the playground).

There must be something wrong with the math I am doing… including rotation quaternions or etc

Also, using the 6 DoF box gizmos out of the box is not a choice for me.

I would really appreciate it if you could help.

Could you elaborate why? Because the simplest solution would be just to customize the gizmos

Hi, @carolhmj.

We don’t want bounding boxes on top of cubes.
And we only want those 4 gizmos on one face.

Please, do not duplicate the post, I will close the other one as a dup. How to re-position or re-scale a cube using positions of other meshes - #5 by pro