Guest User

Untitled

a guest
May 20th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. shader cartesianToSpherical (vector Vector = 0.0, output float Azimuth = 0.0, output float Inclination = M_PI_2, output float Radius = 1.0) {
  2. Radius = length(Vector);
  3. Azimuth = atan2(Vector[1], Vector[0]);
  4. Inclination = acos(Vector[2]);
  5. if(Radius != 0.0) {
  6. Inclination /= Radius;
  7. }
  8. }
Add Comment
Please, Sign In to add comment