three.js Blender导出,对象路径和旋转

时间:2015-01-15 12:07:53

标签: rotation three.js blender

如果有人可以帮我解决问题。我想获得带动画的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; 
  • 我正试图让像飞机一样的飞机飞过某条路。

由于

1 个答案:

答案 0 :(得分:0)

解决方案是在设置四元数后添加初始旋转。我还必须使用flipYZ标志导出JSON。