views:

18

answers:

1

Hi,

I can't figure out a simple solution for the following problem:

  • I start with rotating, scaling and translating a AABB (lets call X) which will result in a OBB (lets call Y)
  • Now I want to figure out a new AABB (lets call Z) inside of the OBB (called Y) which fits best.

How can I solve this?

BTW: I know that there may exists multiple solutions. I think the solution should be unique when the translated,rotated and scaled center of gravity of X is assured to be also in Z the center of gravity.

If a library provides a best fit solution to that problem I would be specially interested in a C++ lib.

A: 

If you mean your box is homogeneous then it's center of gravity coincides with it's geometric center. So if you know your transformation (rotating, scaling...) you can evaluate X's center of gravity in the after-transformed space. But it does not determine Z definitely. So you need more conditions to find a best fit solution. You should determine 'best fit solution' to be unique

Andrew