Skip to content

Instantly share code, notes, and snippets.

@dosterz97
Created May 3, 2022 14:46
Show Gist options
  • Save dosterz97/d1eef54370c54cfba97abc3a8d5f7af2 to your computer and use it in GitHub Desktop.
Save dosterz97/d1eef54370c54cfba97abc3a8d5f7af2 to your computer and use it in GitHub Desktop.
Adding translation and rotation
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