Find Vertical cube size with different Size each axis of the cube

Im Trying to find the vertical cube size and place it on top of what object the mouse is hitting through the selected object to make it absolute untop of the object where the mouse is hitting but the problem is that what am i going to do if the object is rotated the y length wont calculate well so i just need to find the vertical size of a rotated cube

Screenshot 2023-08-11 220641

when its rotated it has a bit more height and also the sides can have more length and also interfere with that.

So Right now i can only make the object be in the middle of the mouse position of the hit object but i want it to find the perfect position to show its size and not clip through like in the center where the mouse hit.

The bounding box could give this vertical length of rotated cube. See an example with a bounding box of a more complex object:

https://codepen.io/boytchev/full/eYLxqjM

Thank you for the help!

1 Like