Could not load ./test.usdz: undefined

Musadiq_Khan
Thu, 27 Jul 2023 06:48:08 +0000
Questions

I am trying to load a usdz file in browser using React and THreejs. Here is my code implementation. However, I keep getting error in console that could not load test.usdz

import React, { useState } from “react”;
import { useLoader } from “@react-three/fiber”;
import { USDZLoader } from “three/examples/jsm/loaders/USDZLoader”;

function App() {
const [usdz, setUsdz] = useState(null);

useLoader(USDZLoader, “./test.usdz”, (loaded) => {
console.log(loaded, “loaded”);
setUsdz(loaded.scene);
});

return ;
}

export default App;

18 posts - 2 participants