I have expanded OBJExporter a bit. It will return an object containing the .obj part and the .mtl part. I just recorded it without testing, so there are probably errors, but I hope where to start.
I did not look for all the mtl values, I just used some standard values ββbesides the color and texture information. Perhaps I will improve it later. You also need to know the mtl file name. I am currently writing a static name for the obj part. When you save the files, the mtl file must be the same name as in the declared object. Otherwise 3ds max, etc. They will not read it.
THREE.OBJExporter = function () {}; THREE.OBJExporter.prototype = { constructor: THREE.OBJExporter, parse: function ( object ) { var output = ''; var materials = {}; var indexVertex = 0; var indexVertexUvs = 0; var indexNormals = 0; var mtlFileName = 'objmaterial';
source share