import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
samliam = mnm.Polygon(np.array([0,-2,0]),
np.array([6,0,0]),
np.array([-4,3,0]),
fill_color='#6644ff',
fill_opacity=1,
color='#ffaaaa',
stroke_width=12)
self.play(
mnm.Write(samliam),
run_time=1.2
)
self.wait(0.3)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
samliam = mnm.Polygon(np.array([6,-2,0]),
np.array([-6.5,-3,0]),
np.array([1,3,0]),
fill_color='#893e7c',
fill_opacity=1,
color='#d7bae8')
self.play(
samliam.animate.round_corners(0.8),
run_time=1.2
)
self.wait(0.3)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
lis_siliam = []
for i in range(11):
siliam = mnm.Square((2+i)/8, # ขนาดด้าน
fill_color='#72c7d6',
fill_opacity=0.8)
lis_siliam.append(siliam)
vg = mnm.VGroup(*lis_siliam) # นำมารวมกลุ่ม
vg.arrange(mnm.LEFT) # จัดให้เรียงต่อกันไปทางซ้าย
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
lis_siliam = []
for i in range(14):
siliam = mnm.Rectangle((2+i)/12, # กว้าง
1+5*i/15, # สูง
fill_color='#8c72d6',
fill_opacity=0.9)
lis_siliam.append(siliam)
vg = mnm.VGroup(*lis_siliam) # นำมารวมกลุ่ม
vg.arrange(mnm.RIGHT) # จัดให้เรียงต่อกันไปทางขวา
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
lis_siliam = []
for i in range(7):
siliam = mnm.RoundedRectangle(width=(2+i)/3, # กว้าง
height=6, # สูง
corner_radius=0.1+0.2*i, # ความโค้งมน
fill_color='#f4c994',
fill_opacity=1)
lis_siliam.append(siliam)
vg = mnm.VGroup(*lis_siliam) # นำมารวมกลุ่ม
vg.arrange(mnm.RIGHT) # จัดให้เรียงต่อกันไปทางขวา
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
lis_rupliam = []
for i in range(8):
rupliam = mnm.RegularPolygon(3+i,
fill_color='#d672b6',
fill_opacity=1-0.1*i)
lis_rupliam.append(rupliam)
vg = mnm.VGroup(*lis_rupliam)
vg.arrange_in_grid(n_cols=4)
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
lis_samliam = []
for i in range(7):
samliam = mnm.Triangle(start_angle=np.radians(15*i),
fill_color='#c4f494',
fill_opacity=0.9-0.15*i)
lis_samliam.append(samliam)
vg = mnm.VGroup(*lis_samliam)
vg.arrange(mnm.RIGHT)
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('เงิน',size=4,color='#dbb4ff')
kroplom = mnm.SurroundingRectangle(text,
buff=1,
color='#91bf64',
stroke_width=20,
fill_color='#ffb4ce',
fill_opacity=0.3)
self.add(text)
self.play(
mnm.Write(kroplom),
run_time=1
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
text = mnm.Text('สมบัติ',size=4.5,color='#bde5c7')
kroplom = mnm.BackgroundRectangle(text,
buff=2,
fill_color='#8b5fb7')
self.add(text)
self.play(
mnm.Write(kroplom),
run_time=1
)
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ