Ajes

Untitled

Jul 26th, 2015
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. vec3 sphere2cube(const in vec3 sphere)
  2. {
  3. vec3 f = abs(sphere);
  4.  
  5. bool a = f.y >= f.x && f.y >= f.z;
  6. bool b = f.x >= f.z;
  7.  
  8. return a ? cubify(sphere.xzy).xzy : b ? cubify(sphere.yzx).zxy : cubify(sphere);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment