hi
I Think you are not specifying your quad vertices in the correct order.By default the polygon vertices must be specifed in the CCW direction with respect to the front face of your polygon(in your case its a QUAD) . May be you are specifying them the wrong way. Let me know if you got my answer correctly.
Hope u the best.
Bye