mrdoob/three.js — Issue #1216: How to show a json file exported from 3ds max in the browser
Author: fennefoss
Created: 2012-01-30 09:51:36+00:00
State: open

Hey guys im pretty new to three.js and im sitting and looking in the examples that the zip file comes with but i cant quit figure out how to put my on .js file into the html so i can see it in the browser. I use the jsonexporter that comes with three.js to convert my 3ds max files to .js

the converted object looks like this.

var model = {

"metadata":
{
"sourceFile": "",
"generatedBy": "3ds max ThreeJSExporter",
"formatVersion": 3,
"vertices": 8,
"normals": 12,
"colors": 0,
"uvs": 12,
"triangles": 12,
"materials": 1
},

"materials": [
{
"DbgIndex" : 0,
"DbgName" : "01 - Default",
"colorDiffuse" : [0.5882, 0.5882, 0.5882],
"colorAmbient" : [0.5882, 0.5882, 0.5882],
"colorSpecular" : [0.9000, 0.9000, 0.9000],
"transparency" : 1.0,
"specularCoef" : 10.0,
"vertexColors" : false
}

],

"vertices": [-28.2214,0.0,36.6534,1.55991,0.0,36.6534,-28.2214,0.0,-31.1037,1.55991,0.0,-31.1037,-28.2214,63.0552,36.6534,1.55991,63.0552,36.6534,-28.2214,63.0552,-31.1037,1.55991,63.0552,-31.1037],

"normals": [0.0,-1.0,0.0,0.0,-1.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,-1.0,-1.0,0.0,0.0,-1.0,0.0,0.0],

"colors": [],

"uvs": [[0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,1.0,0.0,0.0,1.0,0.0]],

"faces": [42,0,2,3,0,9,11,10,0,0,0,42,3,1,0,0,10,8,9,1,1,1,42,4,5,7,0,8,9,11,2,2,2,42,7,6,4,0,11,10,8,3,3,3,42,0,1,5,0,4,5,7,4,4,4,42,5,4,0,0,7,6,4,5,5,5,42,1,3,7,0,0,1,3,6,6,6,42,7,5,1,0,3,2,0,7,7,7,42,3,2,6,0,4,5,7,8,8,8,42,6,7,3,0,7,6,4,9,9,9,42,2,0,4,0,0,1,3,10,10,10,42,4,6,2,0,3,2,0,11,11,11]

}

postMessage( model );
close();

put i am really not sure how to get this .js file loaded in my index file. Can somebody plz help me :)

Thanks