Guest User

Untitled

a guest
May 21st, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. // Start with identity
  2. changeOfBasis = matrix.identity
  3.  
  4. // Construct the basis which represents the difference between the two
  5. // spaces. For a typical left/right handed space, the forward vector is
  6. // inverted. Note that this is not well defined though, as there are many
  7. // possible bases for left and right handed systems.
  8. changeOfBasis[2,2] = -1;
  9.  
  10. // Apply the similarity transform.
  11. newValue = changeOfBasis * value * changeOfBasis.inverse
  12.  
  13. // Note that in this case, the inverse is the change of basis, so this can
  14. // be simplified to:
  15. newValue = changeOfBasis * value * changeOfBasis
  16.  
  17. // Which can be simplified further to 6 multiplies by -1.
Add Comment
Please, Sign In to add comment