Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Start with identity
- changeOfBasis = matrix.identity
- // Construct the basis which represents the difference between the two
- // spaces. For a typical left/right handed space, the forward vector is
- // inverted. Note that this is not well defined though, as there are many
- // possible bases for left and right handed systems.
- changeOfBasis[2,2] = -1;
- // Apply the similarity transform.
- newValue = changeOfBasis * value * changeOfBasis.inverse
- // Note that in this case, the inverse is the change of basis, so this can
- // be simplified to:
- newValue = changeOfBasis * value * changeOfBasis
- // Which can be simplified further to 6 multiplies by -1.
Add Comment
Please, Sign In to add comment