私はいくつかの調査を行い、obj ファイルを Three.js の JSON モデルでインポートできる .js ファイルにエクスポートする方法を学びました。しかし、どうすればそのようなモデルをアニメーション化できますか? 翼を羽ばたかせることを学ぶ必要がある .js 形式の鳥モデルがあります。さらに、インターネットから obj ファイルをダウンロードしたとき、それは無料のモデルだったので、オブジェクトのテクスチャ イメージも含まれていますが、obj を 3D モデリング ソフトウェアの Blender 3d にインポートすると、テクスチャをロードできませんが、テキストエディタから開いたときのobjファイル。それを .js 形式に変換すると、テクスチャ マッピング用の bmp 画像に配置された正しい場所にもなりますが、JSON モデルを使用して webgl にモデルをロードするとロードに失敗します。
誰かが私を正しい方向に向けてくれませんか? この考えをすべて学ぶことができます. お願いします、皆さんからの助けが必要です。
Jsモデルファイルのコード
{
"metadata" :
{
"formatVersion" : 3,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 2652,
"faces" : 4798,
"normals" : 2652,
"colors" : 0,
"uvs" : [1202],
"materials" : 4,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "_5___Default0",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-201.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "_5___Default1",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-200.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "_5___Default2",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-202.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "_5___Default",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-203.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15658496,
"DbgIndex" : 4,
"DbgName" : "_5___Default0",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-201.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 61166,
"DbgIndex" : 5,
"DbgName" : "_5___Default1",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-200.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597806,
"DbgIndex" : 6,
"DbgName" : "_5___Default2",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-202.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 419610,
"DbgIndex" : 7,
"DbgName" : "_5___Default",
"blending" : "NormalBlending",
"colorAmbient" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.8999999761581421, 0.8999999761581421, 0.8999999761581421],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "n-203.bmp",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 2,
"transparency" : 1.0,
"transparent" : false,
"vertexColors" : false
}],