By creating your own loaders you can load data from various input sources. The viewer library only come with a barebones OBJ loader in addition to the speckle loader.
Copy
Ask AI
const objUrl: string = '<your OBJ resource URL>'/** Create a loader for the .obj data */const loader = new ObjLoader(viewer.getWorldTree(), objUrl);/** Load the obj data */await viewer.loadObject(loader, true);
Alternatively, you can load the OBJ from an OBJ file contents as string or ArrayBuffer
Copy
Ask AI
const objData:string | ArrayBuffer = '<your OBJ resource data>'/** Create a loader for the .obj data */const loader = new ObjLoader(viewer.getWorldTree(), '<user defined id>', objData);/** Load the obj data */await viewer.loadObject(loader, true);