21 lines
614 B
Python
21 lines
614 B
Python
import random
|
|
|
|
class Quad(object):
|
|
def __init__(self, points, lerp=random.random()):
|
|
self.points = []
|
|
for i in range(4):
|
|
#lerp = random.uniform(0,0.2)
|
|
#lerp = random.random()
|
|
self.points.append(PVector.lerp(points[i-1],points[i],lerp))
|
|
# self.points.append(PVector(random.randrange(width),random.randrange(height)))
|
|
|
|
|
|
def display(self):
|
|
beginShape()
|
|
for point in self.points:
|
|
vertex(point.x,point.y)
|
|
endShape(CLOSE)
|
|
|
|
def getSize(self):
|
|
return self.points[0].dist(self.points[1])
|