I've been working on bringing a model into a scene using the OBJ loader in THREE.js.
Initially, I had no issues importing the geometry and visualizing it with MeshNormalMaterial. However, as soon as I tried to use textures that require UV coordinates, I encountered this error:
[.WebGLRenderingContext]GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 1
The reason for this error is that the OBJ file lacks UV coordinates. I'm now exploring whether there's a way to automatically generate these texture coordinates instead of manually assigning them. I attempted methods like:
material.needsUpdate = true;
geometry.uvsNeedUpdate = true;
geometry.buffersNeedUpdate = true;
...but unfortunately, none of these worked.
Are there any functions within three.js that can help auto-generate UV textures, or do I need to handle the coordinate assignment myself?