Hi!
I am looking for the best approach regarding scaling an object relative to a specific position of another object. To illustrate this, I have the following image:
The tilted object with the square hole represents the parent object. The smaller object is the child object. In this image, the smaller object is positioned correctly (Fixed to the top of the square hole)
However, it is possible to tilt the bigger object even further, by changing a slider value:
To have the smaller object always aligned perfectly (fixed to the top of the square hole), I am right now gradually:
- Scaling the y axis
- Bringing the y position back (since scaling in babylon apparently moves its position?)
- Adjusting the z pose gradually (since the position of the top of the open hole is not always on the same z axis when adjusting the tilt)
I am looking for a better approach, the current solution imo is a bit too fragile on certain tilt degrees: