When you call your exportGLTF(), it’s important to pass in a scene and not just an array of objects. This should at least solve the problems with the transformation. So do this in your code:
exportGLTF( scene );
However, the model of your house (ODL_2019_Set03) is not correctly exported by GLTFExporter. I’ve manually imported the OBJ/MTL + textures into the three.js editor, see screenshot:
However, when exporting to glTF, the resulting file is rendered like in your screenshot. So it seems it represents only a single part of the entire geometry. There might an issue with GLTFExporter in context of multi-material objects.
If it looks differently before and after exporter through GLTFExporter let’s file a bug, I haven’t set up this full scene to reproduce the issue though, and that would be helpful unless we can reproduce it with plain primitive geometries (e.g. SphereBufferGeometry) and multiple materials.
As you can see the wall is extra bright plus the tree texture is not coming up properly once saved. So what can be the issue? I suspect this is an issue related to the GLTFExporter - not sure though.
One more suggestion I need is that if the issue is specific to GLTFExporter and will need time to be stabilized, what is the way to go forward if we can’t compromise on the quality of the created scene and exported scene - which format should I go for? What are the pros/cons of using JSON-format?
Thanks a lot, the quality actually improved. I still have one doubt though, suppose in a scene I am loading assets from different loaders - say some assets using GLTFLoader and some with OBJLoader - then how are we going to tell the renderer that output with gamma for glTF objects and without gamma for OBJ objects?
That does not work since the setting is global. You have to ensure on application level a correct color space management. That means you have to set the texture encoding of your OBJ assets manually to THREE.sRGBEncoding. Or you apply a change directly to the MTLLoader so diffuse, emissive and specular maps are sRGB encoded.
OBJ-MTL file, I am converting it into GLTF using obj2gltf converter
Should I go with this approach as it gave me better results or is there any better way of doing it? Directly loading the OBJ-MTL file from OBJ-MTL loader and exported gave me bizarre results (https://github.com/mrdoob/three.js/issues/16263) but when converted to glTF, GLTFExporter gave me better results.