我正在尝试绕Z轴旋转GL_LINE_STRIP曲线,但结果显示该曲线从一端拉长。
我认为旋转效果很好,但也许我必须找到一种方法来围绕点旋转整个曲线,以免使原始曲线变形。
def drawlines(coordinates):
glColor3f(0.0,0.0,0.0)
glBegin(GL_LINE_STRIP)
for (x,y) in coordinates:
glVertex2i(x,y)
glEnd()
glFlush()
def drawfig():
glClear(GL_COLOR_BUFFER_BIT)
drawlines(coordinates)
def initOGL():
glClearColor(1.0,1.0,1.0,0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glRotatef(-90,0,0,1)
gluOrtho2D(0,width,0,height)