webarkit / ARnft-threejs

A rendering package for https://github.com/webarkit/ARnft
GNU General Public License v3.0
22 stars 7 forks source link

OBJ + MTL file #36

Open cychong24 opened 2 years ago

cychong24 commented 2 years ago

Hi, I am facing problem in loading OBJ & MTL 3D model using ARnft. Is there any example for this case? As i know using addModel function can only apply to glTF model or glb model. image

kalwalt commented 2 years ago

Hi @cychong24 i moved the issue to ARnft-threejs tracker issue because the question belong to it. And yes i can confrim to you that addModel can only load glTF type of models. It will be nice to add more types of 3d models. In the meantime i think you can use such workaround:

let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid);
let url = "path/to/some.OBJ"
 const loader = new OBJLoader();
        loader.load(url, (obj) => {
            nftAddTJS.add(obj);
        });

I have not tested the code but i will post a live example when i have time.