2015-01-15 86 views
0

如果有人能幫我解決一個問題。我想要獲得帶有動畫的JSON,以特定的路徑行進。three.js Blender export,object path&rotation

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

將溶液四元數被設定後添加初始旋轉。我還必須導出帶有翻轉標記的JSON。

相關問題