Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. vec3 getTransformPositionWithoutMatrix(vec3 _pos,vec3 _rotation){
  2. //ROTATIONS
  3. float sx = sin(_rotation.x);
  4. float cx = cos(_rotation.x);
  5. float sy = sin(_rotation.y);
  6. float cy = cos(_rotation.y);
  7. float sz = sin(_rotation.z);
  8. float cz = cos(_rotation.z);
  9.  
  10.  
  11. //ROTATION X
  12. float xy = cx * _pos.y - sx * _pos.z;
  13. float xz = sx * _pos.y + cx * _pos.z;
  14.  
  15. //ROTATION Y
  16. float yz = cy * xz - sy * _pos.x;
  17. float yx = sy * xz + cy * _pos.x;
  18.  
  19. //ROTATION Z
  20. float zx = cz*yx - sz*xy;
  21. float zy = sz*yx + cz*xy;
  22.  
  23. _pos.x = zx;
  24. _pos.y = zy;
  25. _pos.z = yz;
  26.  
  27. return _pos;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement