Im making an OBB for the stanford bunny for a project. Ive calculated the covarience matrix and found its eigenvectors. The columns of the eigenvector matrix are the components for my rotation matrix, e.g. the first eigenvector column is the first column of my rotation matrix.
To find how much to translate the points to move the OBB back to the centre, I have multiplied a vector containing my centre poitns (xc, yc, zc,1) by the rotation matrix (which I think will give me the new centre point values). I then add the negative of these vales as the translation elements for my transformation matrix.
I then render the bounding box using the max/min points in relation to the x,y,z axis.. Then I do the inverse transformation back. The result is not what I expected.. As you can see, the box is aligned with the new axis, but not in the right way, and it dosent fit around the screwdriver..
Is there something wrong with my theory? Or is the matrix not multiplying correctly.. It seems really far away from the centre if I dont use any translation, but the AOBB calculates perfectly.. Im so confused.
