Example #1
0
 def _text_opacity(self):
     age = self.age()
     if age < self._peer_info_fade_in:
         return sigmoid(age / self._peer_info_fade_in)
     elif age > (self.duration - self._peer_info_fade_out):
         return 1 - sigmoid(1 - (self.duration - age) / self._peer_info_fade_out)
     else:
         return 1
Example #2
0
 def relative_size(self):
     age = self.age()
     if age < self._fade_time:
         return sigmoid(age / self._fade_time)
     elif age > (self.duration - self._fade_time):
         return 1 - sigmoid(1 - (self.duration - age) / self._fade_time)
     else:
         return 1
Example #3
0
 def relative_size(self):
     age = self.age()
     if age > (self.duration - self._fade_time):
         return 1 - sigmoid(1 - (self.duration - age) / self._fade_time)
     else:
         self._amp_smoother.smooth(
             max([abs(value) for value in self.waveform]),
             self.visualizer.time_increment)
         return sigmoid(pow(max(self._amp_smoother.value(), 0), 0.25))
    def position_and_orientation(self, t):
        if t < self._script[0]["t"]:
            return (self._script[0]["position"],
                    self._script[0]["orientation"])
        else:
            n1 = self._get_keyframe_index(t)
            if n1 is None:
                return (self._script[-1]["position"],
                        self._script[-1]["orientation"])
            else:
                n2 = n1 + 1
                t1 = self._script[n1]["t"]
                t2 = self._script[n2]["t"]
                opacity2 = sigmoid((t - t1) / (t2 - t1))

                position1 = self._script[n1]["position"]
                position2 = self._script[n2]["position"]
                position = position1 + (position2 - position1) * opacity2

                orientation1 = self._script[n1]["orientation"]
                orientation2 = self._script[n2]["orientation"]
                orientation = orientation1 + (orientation2 - orientation1) * opacity2

                return (position, orientation)
Example #5
0
 def amp_controlled_color(self, weak_color, strong_color, amp):
     return weak_color + (strong_color - weak_color) * sigmoid(pow(amp, 0.25))
Example #6
0
 def compute_thresholded_activation(self, activation):
     "Applies the sigmoidal function to the given activation."
     return math_tools.sigmoid(activation, self._sigmoid_steepness,
                               self._sigmoid_shift)