2017-11-25 152 views
0

嗨我已經在BABYONJS中創建了一個場景,我試圖在BABYONjs中實現solod系統這裏我讓地球自轉,但我試圖移動不能運行的任何想法的arround。如何使網格在BABYLONJS中移動?

我的代碼

自旋轉

scene.beforeRender = function() {  
     newEarth.rotate(new BABYLON.Vector3(0, 1, 0) , 0.01, 
     BABYLON.Space.WORLD); 
}; 

需要的是地球應角落找尋移動

enter image description here

回答

0

這裏下面我有辦法解決我們ing樞軸矩陣

currentMesh.setPivotMatrix(BABYLON.Matrix.Translation(70, 0, 0)); 
    camera.attachControl(canvas, true); 
    scene.registerBeforeRender(function() { 
     if (currentMesh) { 
      currentMesh.rotate(BABYLON.Axis.Y, Math.PI/64, 
       BABYLON.Space.LOCAL); 
     } 
    }); 

試試這個。