I would think that this doesn't have to be to fast, since you could implement it in some kind of editer that stores a file giving data opn the box.
I think I have a rather good way of getting the pitch ,yaw, and length of the best rectangle. simply measure all the distances between each vertice. then find the longest one. this distance is your boxes length, and the boxes angle. Then, you find all the other vertice's distances from the line (closest distance, that is). The largest distance's vector is then reversed, and the farthest point in the object recorded. now you simply average these two points to get the centerpoint. These two points also give the width-wise diaganol of the bounding box. Then this can be used to define the roll as well, although I'm not sure exactly how. The problem with this scheme so far is that the x and the y of the box will always come out equal. I think this might be solved by getting a line that is perpindicular to the line that defined the diagonol. These lines would then represent the x and y of the box.
This may seem a little like hocus pocus, but I think it may work. Hopefully someone caught on to my idea, and translated the rest of it. My scheme is troublesome to code, but not very iterative. You just have to iterate through the vertices several times. For many purposes iterative aproaches other than mine should work well, but maybe not for runtime loading.
I think I have a rather good way of getting the pitch ,yaw, and length of the best rectangle. simply measure all the distances between each vertice. then find the longest one. this distance is your boxes length, and the boxes angle. Then, you find all the other vertice's distances from the line (closest distance, that is). The largest distance's vector is then reversed, and the farthest point in the object recorded. now you simply average these two points to get the centerpoint. These two points also give the width-wise diaganol of the bounding box. Then this can be used to define the roll as well, although I'm not sure exactly how. The problem with this scheme so far is that the x and the y of the box will always come out equal. I think this might be solved by getting a line that is perpindicular to the line that defined the diagonol. These lines would then represent the x and y of the box.
This may seem a little like hocus pocus, but I think it may work. Hopefully someone caught on to my idea, and translated the rest of it. My scheme is troublesome to code, but not very iterative. You just have to iterate through the vertices several times. For many purposes iterative aproaches other than mine should work well, but maybe not for runtime loading.