Skip to content

Instantly share code, notes, and snippets.

@pofulu
Last active February 27, 2019 08:23
Show Gist options
  • Save pofulu/b8faa1b0455c712df9ee0172d8550a18 to your computer and use it in GitHub Desktop.
Save pofulu/b8faa1b0455c712df9ee0172d8550a18 to your computer and use it in GitHub Desktop.
Rotation utilities for Spark AR Studio
function Rotation(value) {
return Remap(value, -180, 180, Math.PI * -1, Math.PI);
}
function Remap(value, low1, high1, low2, high2) {
return low2 + (value - low1) * (high2 - low2) / (high1 - low1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment