0

I tried to build a smooth rotation for THREE.Object3D via mousemove - without any jitter, gaps, interruption or something else... here is an isolated jsfiddle of my problem: http://jsfiddle.net/vYvmk/

I am not getting it - tried several different scenarios via nested groups etc. i guess Quaternion will do the trick but something went wrong...

4

2 回答 2

1

我刚刚发布了一篇关于旋转可能与您正在寻找的对象相似的对象的帖子:Three.js 中的平滑鼠标旋转

于 2014-09-16T11:31:08.733 回答
1

我不确定,但我的 slerp 解决方案看起来像 mesh.lookAt(mouse3D)?!网格应该围绕目标轴连续旋转......我不确定,但 mesh.quaternion.multiplySelf 应该是诀窍 - 从这里我又遇到了问题 =|

var v = new THREE.Vector3( mouse2D.y, -mouse2D.x, 0 );//.normalize();
var q = new THREE.Quaternion().setFromEuler( v );
var newQuaternion = new THREE.Quaternion();
THREE.Quaternion.slerp( mesh.quaternion, q, newQuaternion, 0.07 );
mesh.quaternion = newQuaternion;
// mesh.quaternion.multiplySelf( newQuaternion );
mesh.quaternion.normalize();

见jsfiddle:http: //jsfiddle.net/DLta8/

于 2012-10-02T11:08:13.703 回答