Python+OpenGL DDA直线段的扫描转换算法
Python+OpenGL DDA直线段的扫描转换算法
算法还是比较容易理解的,glVertex2f()没摸明白。
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import math
def draw():
x0=0
y0=0
x1=500
y1=200
a=y0-y1
b=x1-x0
d=2*a+b
d1=2*a
d2=2*(a
原创
2020-11-04 22:11:44 ·
656 阅读 ·
0 评论