Hi,
I create ON_Box then orient it from one plane to another, but after the transformation the box size changes as if it is ON_BoundingBox. The box should be rotated in space. Why the ON_Box is not rotated properly?
//Create bbox and box
AABB = ON_BoundingBox::EmptyBoundingBox;
p.GetTightBoundingBox(AABB);
ON_Box OBB(AABB);
//Orient box to 3D
OBB.Transform(xformInv);
I am using following transformation:
ON_Xform xformInv;
xformInv.Rotation(planeXY, plane);
I am trying to compute aligned boundingbox from a list of points.
First I oriented all points to XY plane, Second, I made ON_BoundingBox. Third, I converted it to ON_Box. Fourth, I oriented the ON_Box back to 3D (this step fails). I tried with other transformations, ON_Box is acting like ON_BoundingBox. I check ON_Box Planes, in before and after transformation they remain XY planes.
Update:
I can only get it working when I transform plane, not the box itself:
OBB.plane.Transform(xformInv);