# matrix & mirrored vertices

## Recommended Posts

hi, i have a problem with mirrored vertices. I'm exporting vertex information from a CAD system and it is possible, that some vertices (meshes) are designed/placed by mirroring, and the mirroring is stored in the rotation matrix. Is there a way to determine the mirroring for x,y,z ? thanx in advance

##### Share on other sites
if you want to get the mirrored object from the vertices, and the mirror matrix, simply multiply them (Matrix*Vertex)
if not this is what you want, then what? maybe i can help :)

##### Share on other sites
I thought i made myself clear, ... but it seems not.

I have a 3x3 rotation matrix which also stores the information of the mirroring.

For me it is not wanted to get a matrix storing mirroring, because i have an none-mirrored object and i don't want it to be mirrored. So i have to get rid of the mirroring in the matrix or at least to know which axis/es is/are mirrored.

Does anyone know a solution how to extract from the matrix which axis/es is or are mirrored?

thx

##### Share on other sites
i understand now. i think it is not so easy. unfortunately i dont remember how does mirroring work, but i think you wont be able to extract it, since you have other transformations stored in the matrix. finally the solution will lead to a linear equation sytem with infinite solutions (dont know it for sure, ive just finished the first term of linear algebra at the university, and have few practice in matrices/equation systems, or whatever they are called in english)

##### Share on other sites
I've come across this problem when writing exporters for 3ds max. What you need to do is test the parity of the transform matrix for your object. I'm not sure if you can extract which axis is mirrored, but I've never needed to because I always export my verts transformed by the mirror matrix.

Something like this should do the trick (where GetRow(?) returns a vector):

bool GetMatrixParity( matrix& M )
{
return Dot( Cross( M.GetRow(0) , M.GetRow(1) ), GetRow(2) ) < 0.0f );
}

if this returns true, then the matrix contains a mirror - you need to reverse the vertex winding order when rendering trianges/computing normals etc.

Hope that helps

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628333
• Total Posts
2982121

• 22
• 9
• 9
• 13
• 11