Skip to content

Instantly share code, notes, and snippets.

@serguei-k
Last active May 4, 2018 08:06
Show Gist options
  • Save serguei-k/adec08ab71f7471e096bd500884b36b7 to your computer and use it in GitHub Desktop.
Save serguei-k/adec08ab71f7471e096bd500884b36b7 to your computer and use it in GitHub Desktop.
Spherical Coordinates Tutorial Expression 1
float $rate = 3.14 / 2.0;
float $theta = offset.translateX * $rate + control.translateX * $rate;
float $phi = offset.translateY * $rate - control.translateY * $rate;
constraint.translateX = sin($theta) * sin($phi);
constraint.translateY = cos($phi);
constraint.translateZ = cos($theta) * sin($phi);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment