I am trying to make a small logic where I will click on the collision box (pic) and drag in the general direction of the building/house to resize it, I have everything prepped regarding rescaling in proper directions and all I just need to figure out how do I calculate the distance between the start of where I clicked and where my mouse while dragging the mouse so it feels natural like it is snapping to the mouse, the house wall that is.
I had a few ideas but I just cant wrap my head around how do I calculate this so it feels smooth and the wall kind of slides along with your mouse and all, any advice, code or design-wise, would be extremely appreciated
PS. My main reference for something like this is tiny glade
IMHO with scaling you will reach roadblocks really fast. Scaling has it’s own limitations and problems.
You have to procedural generate the mesh on every change. That’s a really high level task you are targeting there.
I love the style and UI/UX in Tiny Glade.
They are rendering every brick of the castles and walls.
Maybe watch this (very technical, only short part about the mesh generation. It’s more about the rendering. Worth a watch)
”Rendering Tiny Glades With Entirely Too Much Ray Marching”
Hey hey, I already am sort of doing something you mentioned here, and I also watched that entire tech overview its quite amazing
The mesh you see is procedural, done by extending the PrimitiveMesh class, and I mean to use it as a base for spawning the roof shingles and other things on top later on using compute shaders, I already built a system like this in Houdini that I will translate over to Godot in time, but what I am trying to figure out is how do I project this kind of distance when trying to scale/extend a mesh in a specific direction, like here I would move one side to Z+ or the other in Z- (all relative ofc).
The main issue is how do I calculate this when dragging over to extend it I hope I cleared it up a little maybe, I know I am pretty vague here
You could use the StaticBody’s input_event signal, it includes a event_position Vector3 value, and the event should include a Vector2 position if InputEventMouse. I’d recommend starting out with the difference in screen position (Vector2) and applying that to your model’s extensions.