TypeError:无法读取未定义的属性“旋转”-three.js

时间:2019-05-22 15:22:24

标签: three.js

我正在尝试使牛顿摇篮移动。而且我得到错误。这是完整的代码https://notepad.pw/s1lozjcy 我知道角度无关。

var tiltDirection = 1;
function render() {
    ball5.animated.rotation.x += tiltDirection * 0.5 * Math.PI/180;
    if(ball5.animated.rotation.x > 103 * Math.PI/180){
        tiltDirection = -1;
    ball5.animated.rotation.x = 2*(103 * Math.PI/180) - ball5.animated.rotation.x;
    }else if(ball5.animated.rotation.x < -22 * Math.PI/180){
        tiltDirection = 1;
    ball5.animated.rotation.x = 2* (-22 * Math.PI/180) - ball5.animated.rotation.x;
        }
        renderer.render(scene, camera);
    }

1 个答案:

答案 0 :(得分:0)

ball5.animated.rotation应该是ball5.rotation吗?