Re: [PATCH] Fix export of transformed soft volumes
Posted: Wed Jul 16, 2008 1:32 pm
Awesome! ... oh drat, that means I left out the transform to the normals when rewriting the sv export. (while correctly transforming the positions) *doof*
Of course, instead of separating, inverting, and transposing the matrix, you could just:
As is done for the vertexes two lines down.
Because for an orthogonal matrix
omatrix.invert() == omatrix.transpose()
A rotation-only matrix is orthogonal, so that's equivalent to inverting it twice:
tmatrix.rotationPart().invert().transpose() == tmatrix.rotationPart()
and if you're normalizing the vector in the next line, you don't need to separate out the rotation.
Of course, instead of separating, inverting, and transposing the matrix, you could just:
- Code: Select all
Nor = tmatrix * Blender.Mathutils.Vector(face.no)
Nor.normalize()
As is done for the vertexes two lines down.
Because for an orthogonal matrix
omatrix.invert() == omatrix.transpose()
A rotation-only matrix is orthogonal, so that's equivalent to inverting it twice:
tmatrix.rotationPart().invert().transpose() == tmatrix.rotationPart()
and if you're normalizing the vector in the next line, you don't need to separate out the rotation.