Created
May 3, 2022 14:46
-
-
Save dosterz97/d1eef54370c54cfba97abc3a8d5f7af2 to your computer and use it in GitHub Desktop.
Adding translation and rotation
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
onPredict = (results) => { | |
... | |
const { | |
pitch, | |
yaw, | |
roll, | |
} = results.rotation | |
this.avatar?.rotation.set(-pitch, yaw, roll) | |
const { | |
x, | |
y, | |
z | |
} = results.transform | |
this.avatar.position.set(x * SCALE, -4 + y * SCALE, z) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment