Skip to content

Instantly share code, notes, and snippets.

@tomaspietravallo
Created October 10, 2020 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaspietravallo/804a89edd745b0cc9ef235477a507aac to your computer and use it in GitHub Desktop.
Save tomaspietravallo/804a89edd745b0cc9ef235477a507aac to your computer and use it in GitHub Desktop.
// Set up a From Script variable called 'r' and drag the script to the Patch Editor
const DM = require('DeviceMotion');
const Patches = require('Patches');
const R = require('Reactive');
// send negated rotation to the patch editor
Patches.inputs.setVector(
'r',
R.vector(
DM.worldTransform.rotation.eulerAngles.x,
DM.worldTransform.rotation.eulerAngles.y,
DM.worldTransform.rotation.eulerAngles.z
).neg()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment