How can I z-order the faces of a 3d object just using the 4 vertices of each of its faces? I've tried using a z-buffer where I store the average z value of each face; this works great most of the times, but fails when an object have large and small faces.
I'm building a small 3d-engine in flash, just for the fun of learning, so the only data i have is those 4 vertices and the normal of the face.
Thanks!