0

I've been fighting with a three.js issue for a few 12 hour days trying to determine why some outward pointed object faces are missing. It only seems to happen if I've modified the mesh model, extruded a plane, or knife projected a hole into a mesh.

I've found a few solutions online that don't seem to be working for me: I've added in the double-sided hack for all materials and this does allow me to see into objects with holes so it is partially working. I've fiddled with different importers (JSONLoader, OBJLoader) which all seem to have the same issues as listed above, so it leads me to believe it is indeed the model itself.

The research I've seen online says that modifying a mesh can leave the normals screwed up so any faces I CAN'T see on my model viewer I just flip and do the UV Map again, but this doesn't fix it.

I'm hoping someone who knows Blender and three.js will know what the problem is. I know it's simple and I'm just missing a step because I'm new.

Here's a link to the demo site and code: http://guitar.dodgestat.com/objloader/

Jay McVety
  • 186
  • 1
  • 2
  • 17

1 Answers1

1

It seems that OBJMTLLoader can handle only triangles and quadrangles, but obj files can describe faces with any number of vertices, but the faces should be convex.

If you check your model with http://3dviewer.net, you can see that every face exists, but there are some issues with non-convex faces.

So I recommend you to triangulate your model before export.

kovacsv
  • 687
  • 4
  • 14
  • ... "the faces should be convex". There are no official specs saying the faces should be convex, and there are many tools that produce non-convex polygons in .obj files (which might even be convenient for further processing of the model by the artist). Triangulating before export is always the right thing to do! – Paul-Jan Jan 01 '15 at 10:11
  • Yes, the convexity requirement is not official, but I always write only convex polygons to obj files because a lot of viewers have problems with concave polygons. – kovacsv Jan 01 '15 at 12:01
  • Regardless of the convexity requirement, triangulation was exactly the problem. Thank you so much! – Jay McVety Jan 02 '15 at 16:35