video
!pip install manim gTTS moviepy
# Import
from manim import *
from gtts import gTTS
from moviepy.editor import VideoFileClip, AudioFileClip
# ----------- Tạo hoạt hình 2D thí nghiệm -----------
class ThiNghiemGuongPhang(Scene):
def construct(self):
# Giấy
giay = Rectangle(width=6, height=4, color=WHITE).shift(DOWN*0.5)
self.play(Create(giay))
# Tấm kính
kinh = Line(start=UP*2, end=DOWN*2, color=BLUE)
self.play(Create(kinh))
# Nến 1
nen1 = VGroup(
Line(DOWN*0.5, UP*0.3, color=RED, stroke_width=8),
Triangle(color=YELLOW, fill_opacity=1).scale(0.1).next_to(UP*0.3, UP, buff=0.05)
).shift(LEFT*2)
self.play(FadeIn(nen1))
# Ảnh nến 1
nen1_anh = nen1.copy().shift(RIGHT*4)
for part in nen1_anh:
part.set_stroke(opacity=0.5, dash_array=[0.1, 0.1])
part.set_fill(opacity=0.5)
self.play(FadeIn(nen1_anh))
# Nến 2
nen2 = VGroup(
Line(DOWN*0.5, UP*0.3, color=GREEN, stroke_width=8),
Triangle(color=ORANGE, fill_opacity=1).scale(0.1).next_to(UP*0.3, UP, buff=0.05)
).shift(RIGHT*3)
self.play(FadeIn(nen2))
# Di chuyển nến 2
self.play(nen2.animate.shift(RIGHT*1), run_time=3)
Nguyễn Thị Dung @ 13:41 19/08/2025
Số lượt xem: 34
- Đề thi cuối HKII môn Sinh học 8 (27/04/23)
- Đề thi và đáp án môn sinh học 8 ( Giữa học kỳ II) (01/04/23)
- BÀI 1. BÀI MỞ ĐẦU (14/10/22)
- BÀI 15. ĐÔNG MÁU VÀ NGUYÊN TẮC TRUYỀN MÁU (09/10/22)
- BÀI 14. BẠCH CẦU – MIỄN DỊCH (09/10/22)
Xin chào các bạn đến với trang web của mình. Chúc các bạn học tập thật tốt nhé!
Các ý kiến mới nhất