【发布时间】:2019-05-22 23:26:13
【问题描述】:
我试图让牛顿摇篮和移动球。我得到错误。这是整个代码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);
}
【问题讨论】:
标签: three.js