3ds Max to three.js - 如何导出简单动画?

时间:2017-05-09 14:44:26

标签: javascript animation three.js 3dsmax

我在3ds Max中有一个非常基本的场景,只有一个cube和一个animation。动画仅将框从position A移动到position B。没有变形目标动画,没有骨头等。只是简单的"运动"动画。

以下是两个关键帧。第一个图像位于关键帧0,第二个图像位于关键帧30处。您可以看到框在这些关键帧之间移动。

enter image description here enter image description here

现在我将cube导出为OBJ格式,并使用python converter将该.obj文件转换为.js文件。

The example I used声明animations上应该有一个animation(或geometry)属性,如下所示:

var animation = new THREE.Animation(
    animatedMesh,
    geometry.animation // this line
);

但是,我转换的js文件没有我在3ds中添加的简单动画,因此geometry.animation在我的示例中返回undefined.js文件如下所示:

{

"metadata" :
{
    "formatVersion" : 3.1,
    "sourceFile"    : "box4.obj",
    "generatedBy"   : "OBJConverter",
    "vertices"      : 8,
    "faces"         : 6,
    "normals"       : 6,
    "colors"        : 0,
    "uvs"           : 4,
    "materials"     : 1
},

"scale" : 1.000000,

"materials": [  {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "wire_061135006",
"colorDiffuse" : [0.2392, 0.5294, 0.0235],
"colorSpecular" : [0.35, 0.35, 0.35],
"illumination" : 2,
"opacity" : 1.0,
"specularCoef" : 32.0
}],

"vertices": [35.029700,0.000000,-19.238000,35.029700,0.000000,-45.844600,45.055000,0.000000,-45.844600,45.055000,0.000000,-19.238000,35.029700,18.650700,-19.238000,45.055000,18.650700,-19.238000,45.055000,18.650700,-45.844600,35.029700,18.650700,-45.844600],

"morphTargets": [],

"morphColors": [],

"normals": [0,-1,-0,0,1,-0,0,0,1,1,0,-0,0,0,-1,-1,0,-0],

"colors": [],

"uvs": [[1,0,1,1,0,1,0,0]],

"faces": [43,0,1,2,3,0,0,1,2,3,0,0,0,0,43,4,5,6,7,0,3,0,1,2,1,1,1,1,43,0,3,5,4,0,3,0,1,2,2,2,2,2,43,3,2,6,5,0,3,0,1,2,3,3,3,3,43,2,1,7,6,0,3,0,1,2,4,4,4,4,43,1,0,4,7,0,3,0,1,2,5,5,5,5]

}

在OBJ的导出窗口中,我没有看到包含FBX导出窗口中的动画的选项。

那么,如何从3ds导出这个简单的动画动画并将其烘焙到我的.js文件中?

0 个答案:

没有答案