Extracting transformation from box mesh

This topic is 2772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hello people !

I have this transformed box mesh that I would like to extract the different transformation components (translation, rotation, scale) from. I'm able to extract vertex positions and their edge relationship, so it's easy to figure out the translation by adding them together and then dividing by 8. If I identify 3 perpendicular edges among the 12 that exist, the distance between their vertices should represent the scale (although I'm not sure about the order). The main thing that puzzles me is the rotation.

Would I be able to safely use the direction of those 3 edges to extract the rotation, and if so - how? It would be convenient to represent the transformation as a 4x4 matrix directly. Could I simply insert the 3 edges as column vectors into a 4x4 matrix and then add the translation into the last one? If this worked then the matrix could be applied to a unit size box and it would be identical to the one I started out with.

I hope I didn't mess up the problem description. Any help is appreciated !

- Dave

Share on other sites
It sounds like you have it right. First you'll need to pick three mutually perpendicular edges that together have a positive determinant/triple product; if you know the order of the vertices, you should be able to draw an image with each vertex labeled, and then choose the edges appropriately.

If the transform is intended to be applied to the unit cube (1x1x1), then you should be able to simply load these vectors into the first three columns of the matrix (assuming column vectors are being used), as you described. The box position would then be stored in the fourth column.

Share on other sites

It sounds like you have it right. First you'll need to pick three mutually perpendicular edges that together have a positive determinant/triple product; if you know the order of the vertices, you should be able to draw an image with each vertex labeled, and then choose the edges appropriately.

If the transform is intended to be applied to the unit cube (1x1x1), then you should be able to simply load these vectors into the first three columns of the matrix (assuming column vectors are being used), as you described. The box position would then be stored in the fourth column.

I've been pondering this solution for some time now but doubted it due to uncertainties like the the edge-column relationship (and the general messiness of rotation matrices). Since the matrix will indeed be applied to a unit cube it makes sense now that the order won't matter. Thanks jyk for helping me believe !

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 9
• 11
• 9
• 9
• Forum Statistics

• Total Topics
633716
• Total Posts
3013500
×