急,请问如何将3d模型数据转换为webgl能支持的json格式
three.js有插件可以将3d模型转为three.js能支持的json格式
但是没有找到将模型数据转为webgl直接能支持的json格式的插件,说明,方法?
求类似插件,工具。总之就是能减少自己编码量的东东:)
之前也从网上找了个obj转为json的工具,不是很好用。
一个json格式的茶壶的例子,有删减
{
"vertexPositions" : [5.929688,4.125,0,5.387188,4.125,2.7475,5.2971,4.494141,2.70917,5.832031,4.494141,0,5.401602,4.617188,2.753633,5.945313,4.617188,0,5.614209,4.494141,2.844092,6.175781,4.494141,0,5.848437,4.125,2.94375,6.429688,4.125,0,3.899688,4.125,4.97,3.830352,4.494141,4.900664,3.910782,4.617188,4.981094,4.074414,4.494141,5.144727,4.254687,4.125,5.325,1.677188,4.125,6.4575,1.638858,4.494141,6.367412,1.68332,4.617188,6.471914,1.77378,4.494141,6.684522,1.873438,4.125,6.91875,-1.070312,4.125,7,-1.070312,4.494141,6.902344,-1.070312,4.617188,7.015625,-1.070312,4.494141,7.246094,-1.070312,4.125,7.5,-1.070312,4.125,7,-4.007656,4.125,6.4575,-3.859572,4.494141,6.367412,-1.070312,4.494141,6.902344,0.54875,4.875,-3.805313,-1.070312,4.875,-4.125,1.198828,4.570313,-5.333203,-1.070312,4.570313,-5.78125,1.480938,4.125,-5.99625,-1.070312,4.125,-6.5,-0.360312,5.625,-0.71,0.549375,5.179688,-1.619688,1.858438,4.875,-2.92875,3.034375,4.570313,-4.104687,3.544688,4.125,-4.615,-0.147812,5.625,-0.3925,1.034141,5.179688,-0.895391,2.735,4.875,-1.619062,4.262891,4.570313,-2.26914,4.925938,4.125,-2.55125,-0.070312,5.625,0,1.210938,5.179688,0,3.054688,4.875,0,4.710938,4.570313,0,5.429688,4.125,0],
"vertexNormals" : [-0.966742,-0.255752,0,-0.893014,-0.256345,-0.369882,-0.893437,0.255996,-0.369102,-0.966824,0.255443,0,-0.083877,0.995843,-0.035507,-0.092052,0.995754,0,0.629724,0.73186,0.260439,0.68205,0.731305,0,0.803725,0.49337,0.332584,0.870301,0.492521,0,-0.683407,-0.256728,-0.683407,-0.683531,0.256068,-0.683531,-0.064925,0.995776,-0.064925,0.481399,0.732469,0.481399,0.614804,0.493997,0.614804,-0.369882,-0.256345,-0.893014,-0.369102,0.255996,-0.893437,-0.035507,0.995843,-0.083877,0.260439,0.73186,0.629724,0.332584,0.493369,0.803725,-0.002848,-0.257863,-0.966177,-0.001923,0.254736,-0.967009,-0.000266,0.995734,-0.09227,0.000024,0.731295,0.682061,0,0.492521,0.870301,-0.002848,-0.257863,-0.966177,0.379058,-0.3593,-0.852771,0.37711,0.149085,-0.914091,-0.001923,0.254736,-0.967009,0.027502,0.992081,-0.122552,-0.000266,0.995734,-0.09227,-0.26101,0.726762,0.635367,0.000024,0.731295,0.682061,-0.332485,0.492546,0.804271,0,0.492521,0.870301,0.663548,-0.41079,-0.625264,0.712664,0.073722,-0.697621,0.099726,0.987509,-0.121983,-0.48732,0.723754,0.488569,-0.615242,0.492602,0.615484,0.880028,-0.332906,-0.338709,0.917276,0.167113,-0.361493,0.113584,0.992365,-0.04807,-0.63415,0.727508,0.261889,-0.804126,0.492634,0.332705,0.96669,-0.255738,0.010454,0.967442,0.252962,0.008103,0.093436,0.995624,0.001281,-0.682167,0.731196,-0.000343,-0.870322,0.492483,-0.000054,0.96669,-0.255738,0.010454,0.893014,-0.256345,0.369882,0.893437,0.255996,0.369102,0.967442,0.252962,0.008103,0.083877,0.995843,0.035507,0.093436,0.995624,0.001281,-0.629724,0.73186,-0.260439,-0.682167,0.731196,-0.000343,-0.803725,0.49337,-0.332584,-0.870322,0.492483,-0.000054,0.683407,-0.256728,0.683407,0.683531,0.217978,0.971775,-0.090216,0.159589,0.984977,-0.065961,0.350498,0.925311,-0.14474,0.48559,0.850653,-0.201475,0.780712,0.62489,0.000075,0.236583,0.971611,0,0.173084,0.984907,0,0.379703,0.925108,0,0.526673,0.850068,0],
"vertexTextureCoords" : [2,2,1.75,2,1.75,1.975,2,1.975,1.75,1.95,2,1.95,1.75,1.925,2,1.925,1.75,1.9,2,1.9,1.5,2,1.5,1.975,1.5,1.95,1.5,1.925,1.5,1.9,1.25,2,1.25,1.975,1.25,1.95,1.25,1.925,1.25,1.9,1,2,1,1.975,1,1.95,1,1.925,1,1.9,1,2,0.75,2,1,0.375,1,0.375,0.75,0.5,0.75,0.375,0.5,0.5,0.5,0.375,0.25,0.5,0.25,0.375,0,0.5,0,0.25,1,0.25,0.75,0.25,0.5,0.25,0.25,0.25,0,0.125,1,0.125,0.75,0.125,0.5,0.125,0.25,0.125,0,0,1,0,0.75,0,0.5,0,0.25,0,0],
"indices" : [0