makiolo

Matrix Transformations

Jun 2nd, 2012
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // POINT
  2.  
  3. object-space to world space
  4. ws = M * os
  5.  
  6. world-space to object space
  7. os = inverse(M) * ws
  8.  
  9. // VECTOR
  10.  
  11. object-space to world space
  12. ws = transpose(inverse(M)) * os
  13.  
  14. world-space to object space
  15. os = transpose(M) * ws;
  16.  
  17. http://www.lighthouse3d.com/tutorials/glsl-tutorial/the-normal-matrix/
  18. http://www.cs.uaf.edu/2007/spring/cs481/lecture/01_23_matrices.html
RAW Paste Data