Appendices >
Normal vectors

The calculation of the tangent space vectors in Mudbox is as follows:

1. Calculating per vertex tangent and binormal vectors for each face.
   - For each vertex A in the face (assume that the two adjacent vertices are B and C)
   - A.tangent = (B.pos-A.pos) * (B.tc.u-A.tc.u) +( C.pos-A.pos) * (C.tc.u-A.tc.u)
   - A.binormal = (B.pos-A.pos) * (B.tc.v-A.tc.v) + (C.pos-A.pos) * (C.tc.v-A.tc.v)
2. Smooth values for common vertices. Each vertex will get a Tangent Normal Binormal index based on the selection in the Index Source combo box in the following way:
   - A. Position: The position index of the vertex will be used. Those vertices with a common 3D positions will use the same tangent space.
   - B. TC: The position index of the vertex will be used. Those vertices with a common 3D positions will use the same tangent space.
   - C. Global: Use a different index for all the vertices, so all vertices will have spearated tangent space.
   NoteVertices with the same index use the same vectors, so their tangent binormal and normal vectors are added together and normalized.
3. Orthogonalization based on the corresponding options selected in the Texture Extraction window.
4. Calculation of the cross products. If you selected an optoin in the user interface regarding this, then the previously calculated vector will be replaced by the cross product of the other two vectors.
5. Switch tangent with binormal if you select the Switch Tangent With Binormal option.
6. Invert vectors marked at the Flip part of the user interface.