我正在尝试使牛顿摇篮移动。而且我得到错误。这是完整的代码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);
}
答案 0 :(得分:0)
ball5.animated.rotation应该是ball5.rotation吗?