def update_at_progress(self, progress, new_loop, loop_instance): self.angle = progress * pi * 2 self.angle2 = (1.0-progress) * pi * 2 self.tilt += random.random()*self.tilt_change self.tilt2 += self.tilt_change #self.tilt = self.tilt % (pi / 3) # dz is from -1 to 1 if (loop_instance % 2): # up self.dz = 1 - 2 * progress self.dy = 1 - 2 * progress else: # down self.dz = - (1 - 2 * progress) self.dy = - (1 - 2 * progress) if self.rainbow: self.color = rainbow_(progress, loop_instance, self.cm.brightness) self.color2 = rainbow_(progress+0.3, loop_instance, self.cm.brightness)
def update_at_progress(self, progress, new_loop, loop_instance): if (loop_instance % 2): # one side self.dx = 1 - 2 * progress else: # other side self.dx = - (1 - 2 * progress) if self.trail > 0.85: self.sign = -1 if self.trail < 0.05: self.sign = 1 self.trail += random.random()*0.01 * self.sign if self.rainbow: self.prog = self.prog + (random.random()*0.01) % 1 self.color = rainbow_(self.prog, loop_instance, self.cm.brightness)
def update_at_progress(self, progress, new_loop, loop_instance): # dz is from -1 to 1 if (loop_instance % 2): # up self.dz = 1 - 2 * progress else: # down self.dz = - (1 - 2 * progress) if self.trail > 0.95: self.sign = -1 if self.trail < 0.05: self.sign = 1 self.trail += random.random()*0.01 * self.sign if self.rainbow: self.color = rainbow_(progress, loop_instance, self.cm.brightness)