c++ - Ear cliping - right perspective -


I am using OpenGL now I am programming 3D model loader using the ear clipping algorithm. My main problem is that what axis should I use I have 3 options: (xy), (jd y), (x z). For example, if I need a quad - 4 digit - (1, 1, 0) (-1, 1, 0) (-1, -1, 0) (1, -1, 0) I need (xy) It is the axis because all zs are the same.

So I'm trying to program some code which requires 2 axes which I know. It checks whether the axis is similar to each other.

But this code only works when an axis is the same. When polygon does not work on the code diagonally, I have been added to the code to check a function that checks all the rows on the same line, then I found this polygon and my code failed:

...

You can see that it is the top on top, right There are 3 top calculations on the top and as you can see (XZ) is the correct axis that I should fix. If you look at the (ZWY) axis, you can see it:

...

On the left one head, one middle and 3 calculations on the right. Not all corners are on the same line and I can not see which axis should be used. Because if I use (ZY) axis, the ear clipping algorithm will not work.

How do I know which 2 axis should be used? I'm using C ++.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -