【发布时间】:2012-09-22 19:57:07
【问题描述】:
我尝试通过 mousemove 为 THREE.Object3D 构建平滑的旋转 - 没有任何抖动、间隙、中断或其他任何东西...... 这是我的问题的一个孤立的 jsfiddle:http://jsfiddle.net/vYvmk/
我不明白 - 通过嵌套组等尝试了几种不同的场景。 我猜四元数会解决问题,但出了点问题......
【问题讨论】:
-
pv3d.org/2008/12/28/click-then-tween-camera-to-plane slerp to plane -- as3 可能是一些有用的资源
-
你能更清楚地解释发生了什么问题吗?
-
当我使用鼠标坐标作为矢量时 - 旋转变得疯狂......我认为应该从原点进行旋转?我没有进入它。我会检查上面的链接。
-
试过:var time = Date.now() * .0025; var va = new THREE.Quaternion().setFromRotationMatrix(mesh.matrix); var vb = new THREE.Quaternion().setFromEuler(vector);//(vector.x,vector.y,vector.z,1); var vc = new THREE.Quaternion();三.四元数.slerp(va,vb,vc,时间); //mesh.quaternion = vc; mesh.quaternion.multiplySelf(vc); mesh.quaternion.normalize();
-
好吧,我越来越近了——但这看起来更像 mesh.lookAt(mouse3D)?!网格应该连续旋转... var q = new THREE.Quaternion().setFromEuler(vector ); var newQuaternion = new THREE.Quaternion();三.四元数.slerp(mesh.quaternion, q, newQuaternion, 0.07); mesh.quaternion = newQuaternion; mesh.quaternion.normalize();
标签: javascript animation vector rotation three.js