Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active June 5, 2026 07:58
Show Gist options
  • Select an option

  • Save uwezi/33eeb2d5ecce4ac7624dd36cc3856f4b to your computer and use it in GitHub Desktop.

Select an option

Save uwezi/33eeb2d5ecce4ac7624dd36cc3856f4b to your computer and use it in GitHub Desktop.
[exploding text] Splitting text into small pieces and explode. #manim #text #animation #visualeffect
class Explosion(Scene):
def construct(self):
# make a single object of your text
text = Union(*Text("Hello World", font_size=100)).set_stroke(width=0).set_fill(opacity=1)
self.add(text)
delta = 0.1
pieces = VGroup(
Intersection(text, Square(side_length=delta).move_to([x,y,0])).set_stroke(width=0).set_fill(opacity=1)
for x in np.arange(text.get_left()[0],text.get_right()[0]+delta,delta)
for y in np.arange(text.get_bottom()[1],text.get_top()[1]+delta,delta)
)
self.play(FadeOut(text),FadeIn(pieces))
self.play(
piece.animate.move_to([10*np.cos(a),10*np.sin(a),0])
for piece,a in zip(pieces, np.random.uniform(0,2*PI,size=len(pieces)))
)
self.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment