Guest User

Untitled

a guest
Jul 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. // No means provided to get the matrix from a transformation, so this will need to do
  2. Matrix4x4 TransformationToMatrix(Transformation &t)
  3. {
  4. float temp[16];
  5. t.ArrayForOpenGL(temp); // This method is non-const (?) so I can't pass by reference to const
  6.  
  7. Matrix4x4 m;
  8. for (unsigned int row = 0; row < 4; ++row)
  9. {
  10. for (unsigned int col = 0; col < 4; ++col)
  11. {
  12. // Copy transposed
  13. m[row][col] = *(temp + col * 4 + row);
  14. }
  15. }
  16.  
  17. return m;
  18. }
Add Comment
Please, Sign In to add comment