title: React three fiber add texture to obj model
body: <p>In my app I want to add texture to the loaded .obj model. I have the same situation with my .fbx loaded models. Below is my example code, but this works only with something like sphereGeometry not with a loaded model.</p>
  <p>Thanks in Advance!</p>
  <pre><code>import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader'
  import { useTexture } from '@react-three/drei'
  
  const OBJModel = ({ file }: { file: string }) =&gt; {
    const obj = useLoader(OBJLoader, file)
    const texture = useTexture(textureFile)
  
    return (
      &lt;mesh&gt;
        &lt;primitive object={obj} /&gt;
        &lt;meshStandardMaterial map={texture} attach=&quot;material&quot; /&gt;
      &lt;/mesh&gt;
    )
  }
  </code></pre>