如果有人可以帮我解决问题。我想获得带动画的JSON,在某条路上旅行。
var up = new THREE.Vector3(0,1,0);
var pt,radians,tangent;
var axis = new THREE.Vector3();
var pot = new THREE.SplineCurve3([
new THREE.Vector3(640,360,510),
new THREE.Vector3(650,360,520),
new THREE.Vector3(0,20,0)]);
....
pt = pot.getPoint(stevec);
meshK.position.set(pt.x,pt.y,pt.z);
tangent=pot.getTangent(stevec).normalize();
axis.crossVectors(up,tangent).normalize();
radians=Math.acos(up.dot(tangent));
meshK.quaternion.setFromAxisAngle(axis,radians);
//meshK.eulerOrder='ZYX';
stevec+=0.001;
由于
答案 0 :(得分:0)
解决方案是在设置四元数后添加初始旋转。我还必须使用flipYZ标志导出JSON。