如何在ThreeJs中应用Quaternion时增加fbx大小

时间:2018-05-17 09:36:27

标签: three.js quaternions

我尝试使用fbx加载器加载对象并应用四元数在轨道中旋转。旋转正在进行,但物体在屏幕上看起来很远。

以下是我尝试的代码。

fbxLoader.load('models/fbx/yarn_with_mtl.fbx', function (yarn) {
    yarn.traverse(function(child) {
        if (child instanceof THREE.Mesh) {
            child.receiveShadow = true;
            child.castShadow = true;
        }
    });
    yarn.name = "yarn";
    yarn.position.set(0, 0, 688);// this increases to right size
    yarnModal = yarn;
    scene.add(yarn);
});


quaternion.setFromAxisAngle(axis, 0.005);
if(yarnModal)yarnModal.position.applyQuaternion(quaternion); //This is reseting the object size back to small

0 个答案:

没有答案