示例#1
0
 def get_sub_alpha(self, alpha, index, num_submobjects):
     if self.submobject_mode in ["lagged_start", "smoothed_lagged_start"]:
         prop = float(index) / num_submobjects
         if self.submobject_mode is "smoothed_lagged_start":
             prop = smooth(prop)
         lf = self.lag_factor
         return np.clip(lf * alpha - (lf - 1) * prop, 0, 1)
     elif self.submobject_mode == "one_at_a_time":
         lower = float(index) / num_submobjects
         upper = float(index + 1) / num_submobjects
         return np.clip((alpha - lower) / (upper - lower), 0, 1)
     elif self.submobject_mode == "all_at_once":
         return alpha
     raise Exception("Invalid submobject mode")
示例#2
0
 def get_sub_alpha(self, alpha, index, num_submobjects):
     if self.submobject_mode in ["lagged_start", "smoothed_lagged_start"]:
         prop = float(index) / num_submobjects
         if self.submobject_mode is "smoothed_lagged_start":
             prop = smooth(prop)
         lf = self.lag_factor
         return np.clip(lf * alpha - (lf - 1) * prop, 0, 1)
     elif self.submobject_mode == "one_at_a_time":
         lower = float(index) / num_submobjects
         upper = float(index + 1) / num_submobjects
         return np.clip((alpha - lower) / (upper - lower), 0, 1)
     elif self.submobject_mode == "all_at_once":
         return alpha
     raise Exception("Invalid submobject mode")
示例#3
0
class Uncreate(ShowCreation):
    CONFIG = {
        "rate_func" : lambda t : smooth(1-t),
        "remover"   : True
    }