Exemplo n.º 1
0
 def plot(self, t):
     color = int(mmath.travel(t, 20, 0, 5))
     for pf in self.storyboard:
         if pf.touched:
             print "[TOUCH] Human address %d" % (pf.human_address)
         pf.blackout()
         if color == 0:
            pf.red = pf.MAX_RED
         elif color == 1:
            pf.green = pf.MAX_GREEN
         elif color == 2:
            pf.blue= pf.MAX_BLUE
         elif color == 3:
            pf.white = pf.MAX_WHITE
         elif color >= 4:
            pf.uv = pf.MAX_UV
     return color < 5
Exemplo n.º 2
0
 def plot(self, t):
     if self.last_change is None:
         self.last_change = t
     if len(self.foci) == 0:
         return False
     focus_idx = int(mmath.travel(t, self.span, 0, len(self.foci)))
     if focus_idx >= len(self.foci):
         return False
     focus = self.foci[focus_idx]
     if self.last_focus is not focus and self.last_focus is not None:
         # Change last focuses RGB so it transitions in unform with others
         for pf in self.storyboard:
             if pf is not self.last_focus:
                 self.last_focus.rgb = pf.rgb
         self.last_change = t
     self.last_focus = focus
     focus.blackout()
     focus.white = focus.MAX_WHITE / 3
     for pf in self.storyboard:
         if pf is focus:
             continue
         pf.white = pf.MIN_WHITE
         focus.mood(pf, t - self.last_change, self.time_per_frame)
     return not self.storyboard.touched
Exemplo n.º 3
0
 def calc(self, t):
     value = mmath.travel(t, self.span, self.original_value, self.target_value)
     self.last_value = value
     return value