Hi,
The bounds should be transformed by the post transform you set (if you wait for the data to be ready before configuring transforms), as shown by the
implementation of drawable here.
However the way BoundingBox3d
applies the transform is bit poor. First it has
no unit test to check what should work. But the most important is that I suspect this implementation to only be able to properly deal with scale and shifts, but not with rotation. A naive fix would be to transform
all corners of the initial bounding box and then build a new bounding box with all these transformed points.
FYI, Two objects provide the math to properly rotate points :
Coord3d,
Rotate.
You could evaluate my assumption by simply overriding your DrawableVBO2.setTransformBefore and here hack the bounds (there is no setBounds() on purpose). If this works, a clean fix should rather be in BoundingBox3d.apply. That would be great if you could create a merge request with a unit test on the bounding box.
Let me know if this works.
I tried what you did in your sample file. It still shakes objects sometime and get them shifted with a factor similar to margin on the axis side. Maybe this will be easier to work on your MR when you have time to do so. But thanks :)