我試圖在Three.JS中使用Won的WebGL加載程序(http://code.google.com/p/webgl-loader/)轉換爲UTF8格式顯示3D模型。我不知道如何將從WebGL Loader輸出的元數據轉換爲Three.JS期望的內容,而Google搜索並通過源代碼閱讀並未發現任何見解。 WebGLLoader的輸出和下面列出的Three.JS的輸入要求。Three.JS UTF8加載程序
WebGL的裝載機產量:
MODELS['abc_normals.obj'] = {
materials: {
},
decodeParams: {
decodeOffsets: [-8192,-88,-2278,0,0,-511,-511,-511],
decodeScales: [0.012115,0.012115,0.012115,0.000978,0.000978,0.001957,0.001957,0.001957],
},
urls: {
'abc_normals.utf8': [
{ material: '',
attribRange: [0, 8288],
indexRange: [66304, 14914],
bboxes: 111046,
names: ['default', ],
lengths: [44742, ],
},
],
}
};
three.js所要求:
{ scale: 0.815141, offsetX: -0.371823, offsetY: -0.011920, offsetZ: -0.416061 }
試試這個我試過,版本,得到了下面的輸出是不完全的形式three.js所期望 - 偏移:77.663857,0.552530,27.608030,-0.000000, - 0.000000,1.000000,1.000000,1.000000], 比例尺:[182.835129,182.835129,182.835129,1.000000,1.000000,2.000000,2.000000,2.000000],比特:[14,14,14,10,10,10,10,10] – 2012-07-29 19:07:25