3d engine: ordering of faces
Author |
Message |
Sharkbait
|
Posted: Mon May 11, 2009 9:14 am Post subject: 3d engine: ordering of faces |
|
|
currently i'm sorting the faces based on thier max and min values and with some success. Unfortunately when i'm rotating things I often end up with faces out of order (mostly the triangular parts). Is there another way to sort the faces so that i can avoid this problem? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DemonWasp
|
Posted: Mon May 11, 2009 9:37 am Post subject: RE:3d engine: ordering of faces |
|
|
1. Make sure you're back-culling faces so that you can skip extra work in the sorting phase. Basically, this means "eliminate any faces that are pointed the other way". This improves the ordering of faces because anything pointed away from the camera will not be rendered, so faces won't poke through the "back" of thin objects.
2. You could order by average distance of the points from the camera. This works well excepting when you have long polygons that extend from near the camera to further away. |
|
|
|
|
|
|
|