当前位置: 首页>>代码示例>>Python>>正文


Python VMobject.submobject_gradient_highlight方法代码示例

本文整理汇总了Python中mobject.vectorized_mobject.VMobject.submobject_gradient_highlight方法的典型用法代码示例。如果您正苦于以下问题:Python VMobject.submobject_gradient_highlight方法的具体用法?Python VMobject.submobject_gradient_highlight怎么用?Python VMobject.submobject_gradient_highlight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mobject.vectorized_mobject.VMobject的用法示例。


在下文中一共展示了VMobject.submobject_gradient_highlight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: construct

# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import submobject_gradient_highlight [as 别名]
    def construct(self):
        line = NumberLine()
        self.add(line, *self.get_mobjects())
        offset = LEFT+DOWN
        vect = 2*RIGHT+UP
        dots = VMobject(*[
             Dot(offset + a*vect, radius = 0.075)
             for a in np.linspace(-2, 3, 18)
        ])
        dots.submobject_gradient_highlight(YELLOW_B, YELLOW_C)
        func = self.get_matrix_transformation(self.t_matrix)
        new_dots = VMobject(*[
            Dot(
                func(dot.get_center()), 
                color = dot.get_color(),
                radius = dot.radius
            )
            for dot in dots
        ])
        words = TextMobject(
            "Line of dots remains evenly spaced"
        )
        words.next_to(line, UP, buff = MED_SMALL_BUFF)

        self.play(Write(dots))
        self.apply_transposed_matrix(
            self.t_matrix,
            added_anims = [Transform(dots, new_dots)]
        )
        self.play(Write(words))
        self.dither()
开发者ID:PythonJedi,项目名称:manim,代码行数:33,代码来源:footnote2.py

示例2: construct

# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import submobject_gradient_highlight [as 别名]
 def construct(self):
     word = TextMobject("``Parallelepiped''")
     word.scale(2)
     pp_part1 = VMobject(*word.split()[:len(word.split())/2])
     pp_part2 = VMobject(*word.split()[len(word.split())/2:])
     pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR)
     pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR)
     self.play(Write(word))
     self.dither(2)
开发者ID:xhrwang,项目名称:manim,代码行数:11,代码来源:chapter5.py

示例3: construct

# 需要导入模块: from mobject.vectorized_mobject import VMobject [as 别名]
# 或者: from mobject.vectorized_mobject.VMobject import submobject_gradient_highlight [as 别名]
 def construct(self):
     self.lock_in_faded_grid()
     vectors = VMobject(*[
         Vector([x, y])
         for x in np.arange(-int(SPACE_WIDTH)+0.5, int(SPACE_WIDTH)+0.5)
         for y in np.arange(-int(SPACE_HEIGHT)+0.5, int(SPACE_HEIGHT)+0.5)
     ])
     vectors.submobject_gradient_highlight(PINK, BLUE_E)
     words = TextMobject("Span")
     words.scale(3)
     words.to_edge(UP)
     words.add_background_rectangle()
     self.add(vectors, words)
开发者ID:scottopell,项目名称:manim,代码行数:15,代码来源:thumbnails.py


注:本文中的mobject.vectorized_mobject.VMobject.submobject_gradient_highlight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。