Created
October 10, 2020 20:36
-
-
Save tomaspietravallo/804a89edd745b0cc9ef235477a507aac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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