Hi @Gnan_Eswar
Here is an updated version of the same sandbox which loads the .obj file directly. The OBJLoader is able to load objects in two ways:
-
By obj path/url:
new ObjLoader(viewer.getWorldTree(), url)
-
By obj contents:
new ObjLoader(viewer.getWorldTree(), "id", obj_contents)
Because of how the live sandboxes work, I chose to load the .obj by file contents rather than URL to avoid external fetches which might not work anyway because of CORS. Keep in mind that the ability to import .obj files like in the sandbox import d20_obj_contents from "../assets/d20.obj";
might depend on you project setup and it’s independent of the viewer library
One thing to keep in mind, is that the current OBJLoader only loads in geometry. So you won’t be able to load any materials you might have exported with the .obj
Cheers