Fix degToRad undefined
The THREE library changes the Math module o MathUtils. So trying to do Math.degToRad gives an undefined function error. Fix is to replace Math.degToRad to MathUtils.degToRad. Signed-off-by: Juan D Polanco Avalos <juan.polanco.avalos@intel.com>
This commit is contained in:
parent
bb2e3dd29c
commit
4721c4cbbd
1 changed files with 6 additions and 6 deletions
12
js/script.js
12
js/script.js
|
|
@ -456,17 +456,17 @@ async function render() {
|
|||
if (showCalibration) {
|
||||
// BNO055
|
||||
let rotationEuler = new THREE.Euler(
|
||||
THREE.Math.degToRad(360 - orientation[2]),
|
||||
THREE.Math.degToRad(orientation[0]),
|
||||
THREE.Math.degToRad(orientation[1]),
|
||||
THREE.MathUtils.degToRad(360 - orientation[2]),
|
||||
THREE.MathUtils.degToRad(orientation[0]),
|
||||
THREE.MathUtils.degToRad(orientation[1]),
|
||||
'YZX'
|
||||
);
|
||||
bunny.setRotationFromEuler(rotationEuler);
|
||||
} else {
|
||||
let rotationEuler = new THREE.Euler(
|
||||
THREE.Math.degToRad(orientation[2]),
|
||||
THREE.Math.degToRad(orientation[0]-180),
|
||||
THREE.Math.degToRad(-orientation[1]),
|
||||
THREE.MathUtils.degToRad(orientation[2]),
|
||||
THREE.MathUtils.degToRad(orientation[0]-180),
|
||||
THREE.MathUtils.degToRad(-orientation[1]),
|
||||
'YZX'
|
||||
);
|
||||
bunny.setRotationFromEuler(rotationEuler);
|
||||
|
|
|
|||
Loading…
Reference in a new issue