I'm writing a simple PyOpenGL code, with the display part as
glBegin(GL_LINE_LOOP)
glVertex2f(0,0)
glVertex2f(0,1)
glVertex2f(1,1)
glVertex2f(1,0)
glEnd()
I want to export this model as a .OBJ file. Is there any library or algorithm I could use?
I searched for a while, but could only get resources to open a .OBJ model in OpenGL, not vice-versa.