mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 05:48:57 +08:00
cleaning up viewer code (#101)
This commit is contained in:
1 parent
b40ec1e863
commit
74ec84117e
30 files changed
+829
-11362
No files matched your search
@@ -2,7 +2,7 @@ import * as THREE from "three";
|
||||
import { OBJLoader } from "three/examples/jsm/loaders/OBJLoader.js";
|
||||
import { ColladaLoader } from "three/examples/jsm/loaders/ColladaLoader.js";
|
||||
import { MTLLoader } from "three/examples/jsm/loaders/MTLLoader.js";
|
||||
// import {MtlObjBridge} from 'three/examples/jsm/loaders/obj2/bridge/MtlObjBridge.js';
|
||||
import { MtlObjBridge } from "wwobjloader2";
|
||||
import { STLLoader } from "three/examples/jsm/loaders/STLLoader.js";
|
||||
import { PLYLoader } from "three/examples/jsm/loaders/PLYLoader.js";
|
||||
import * as BufferGeometryUtils from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
||||
@@ -193,11 +193,10 @@ export class ExtensibleObjectLoader extends THREE.ObjectLoader {
|
||||
if (json.mtl_library) {
|
||||
let mtl_loader = new MTLLoader(manager);
|
||||
let mtl_parse_result = mtl_loader.parse(json.mtl_library + "\n", "");
|
||||
console.log(mtl_parse_result);
|
||||
// let materials = MtlObjBridge.addMaterialsFromMtlLoader(mtl_parse_result);
|
||||
// console.log(materials);
|
||||
// loader.addMaterials(materials);
|
||||
// this.onTextureLoad();
|
||||
let materials =
|
||||
MtlObjBridge.addMaterialsFromMtlLoader(mtl_parse_result);
|
||||
loader.setMaterials(materials);
|
||||
this.onTextureLoad();
|
||||
}
|
||||
let obj = loader.parse(json.data + "\n", path);
|
||||
geometry = merge_geometries(obj, true);
|
||||
|
||||
Reference in new issue
Block a user