class Threshold(object): def __init__(self, pos, fade_in = 1.0): self.pos = pos self.alpha = 0.0 self.inc = Increment(1.0, fade_in) def render(self): glPushMatrix() glTranslate(0.0, self.pos, 0.0) glDisable(GL_POLYGON_OFFSET_FILL) glColor(0x00/float(0xff), 0xff/float(0xff), 0xff/float(0xff), self.alpha) glutWireCube(1) glScale(3.0, 0.0, 3.0) glPolygonOffset(1.0, 1.0) glEnable(GL_POLYGON_OFFSET_FILL) glColor(0x00/float(0xff), 0xff/float(0xff), 0xff/float(0xff), 0.4*self.alpha) glutSolidCube(1) glDisable(GL_POLYGON_OFFSET_FILL) glColor(0x00/float(0xff), 0xff/float(0xff), 0xff/float(0xff), self.alpha) glutWireCube(1) glPopMatrix() def update(self, ts): if self.inc.is_complete is False: self.inc.update(ts) self.alpha = self.inc.get()
def __init__(self, pos, fade_in = 1.0): self.pos = pos self.alpha = 0.0 self.inc = Increment(1.0, fade_in)