Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

manim replacement transform

from manim import *

class ReplacementTransformOrTransform(Scene):
    def construct(self):
        # set up the numbers
        r_transform = VGroup(*[Integer(i) for i in range(1,4)])
        text_1 = Text("ReplacementTransform", color=RED)
        r_transform.add(text_1)

        transform = VGroup(*[Integer(i) for i in range(4,7)])
        text_2 = Text("Transform", color=BLUE)
        transform.add(text_2)

        ints = VGroup(r_transform, transform)
        texts = VGroup(text_1, text_2).scale(0.75)
        r_transform.arrange(direction=UP, buff=1)
        transform.arrange(direction=UP, buff=1)

        ints.arrange(buff=2)
        self.add(ints, texts)

        # The mobs replace each other and none are left behind
        self.play(ReplacementTransform(r_transform[0], r_transform[1]))
        self.play(ReplacementTransform(r_transform[1], r_transform[2]))

        # The mobs linger after the Transform()
        self.play(Transform(transform[0], transform[1]))
        self.play(Transform(transform[1], transform[2]))
        self.wait()
Comment

manim replacement transform

from manim import *

class ReplacementTransformOrTransform(Scene):
    def construct(self):
        # set up the numbers
        r_transform = VGroup(*[Integer(i) for i in range(1,4)])
        text_1 = Text("ReplacementTransform", color=RED)
        r_transform.add(text_1)

        transform = VGroup(*[Integer(i) for i in range(4,7)])
        text_2 = Text("Transform", color=BLUE)
        transform.add(text_2)

        ints = VGroup(r_transform, transform)
        texts = VGroup(text_1, text_2).scale(0.75)
        r_transform.arrange(direction=UP, buff=1)
        transform.arrange(direction=UP, buff=1)

        ints.arrange(buff=2)
        self.add(ints, texts)

        # The mobs replace each other and none are left behind
        self.play(ReplacementTransform(r_transform[0], r_transform[1]))
        self.play(ReplacementTransform(r_transform[1], r_transform[2]))

        # The mobs linger after the Transform()
        self.play(Transform(transform[0], transform[1]))
        self.play(Transform(transform[1], transform[2]))
        self.wait()
Comment

PREVIOUS NEXT
Code Example
Python :: way to close file python with staement 
Python :: python run only when list is bigger 
Python :: Django-rest-framework-simplejwt.readthedocs.io 
Python :: calculate values in a certain percentile pandas 
Python :: How to run smtp4dev as a dotnet global tool 
Python :: python check anangram 
Python :: eastcoders: django-meta-class 
Python :: Illustrate Different Set Operations 
Python :: quicksort python3 
Python :: how to download a website using python 
Python :: how to save the command result with ! in python 
Python :: frontmost flag qt 
Python :: python dash bootstrap buttons with icons 
Python :: how to use ttk themes 
Python :: Python Textfeld lköschen 
Python :: c# script for download music from telegram channel 
Python :: how to find left top width and height on an image using python 
Python :: flask conditional according to urrl 
Python :: ldap python how to print entries 
Python :: how to element into the first index python 
Python :: Reading from a file way01 
Python :: python multiple imports 
Python :: Python Class Without Getters and Setters 
Python :: Python - pasword hashed 
Python :: pip package dynamic setup.py example 
Python :: Generate bootstrap replicate of 1D data that return a particular operation 
Python :: set layer start and end time arcpy 
Python :: get mismatch element in allclose numpy 
Python :: how to make change the default from python 3.8 to python 3.10.5 on Mint 20 
Python :: how to prefix numbers with zero in python 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =