gpvigano / AsImpL

Asynchronous Importer and run-time Loader for Unity
MIT License
212 stars 37 forks source link

Support for faces with more than 4 vertices #19

Closed gpvigano closed 5 years ago

gpvigano commented 6 years ago

Currently AsImpL supports faces with 3 or 4 vertices. A proper triangulation algorithm should be implemented to support faces with more vertices.

gpvigano commented 6 years ago

Added a very simple triangulation in the OBJ loader (see b388f439b69edd4b83dd2f4d4281240eb2fa2471), improvements can be done.

gpvigano commented 6 years ago

The current triangulation does not work for concave polygons, i.e. the guitar model referenced by @LucasWalters in issue #3 looks like this: guitar_asimpl (notice the wrong triangulation of the dark polygon in the centre)

anandmulay3 commented 6 years ago

Is this inverted face issue solved? do we have a updated plugin now? And many thanks @gpvigano, this plugin is just awesome :)

gpvigano commented 6 years ago

Sorry, not yet. I think there's not a trivial solution (a proper triangulation algorithm must be implemented) and I understand this is an important issue, but I haven't a solution, at the moment. I hope someone will help us.

gpvigano commented 5 years ago

To ease the integration of external triangulation code in AsImpL I moved triangulation to a proper method in the Dataset/Triangulator.cs script. See my commit.

Here we can find a solution for the triangulation of convex polygons. The author allows integrating that code into AsImpL.

gpvigano commented 5 years ago

I finally managed to implement a decent triangulation in my last commit, starting from Erik Nordeus's tutorial. Here you can see how the previous guitar model is loaded now:

asimpl_earclipping_guitar

I hope someone will test this new version and will give me a feedback...

LucasWalters commented 5 years ago

Looks good, thanks for the update!