Opengl arbitrary polygon algorithm