mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Rewrite stroke and fill shaders (#1716)
Rewrite vectorized mobject shaders to be compatible with transformation matrices.
This commit is contained in:
parent
dba9f4da1e
commit
3ee3ea1a3e
19 changed files with 587 additions and 22 deletions
|
|
@ -2,7 +2,6 @@ import os
|
|||
from pathlib import Path
|
||||
|
||||
import manim.utils.opengl as opengl
|
||||
import manim.utils.space_ops as space_ops
|
||||
from manim import *
|
||||
from manim.opengl import *
|
||||
|
||||
|
|
@ -72,6 +71,24 @@ def get_plane_mesh(context):
|
|||
return Mesh(shader, attributes)
|
||||
|
||||
|
||||
class TextTest(Scene):
|
||||
def construct(self):
|
||||
import string
|
||||
|
||||
text = OpenGLText(
|
||||
string.ascii_lowercase, stroke_width=4, stroke_color=BLUE
|
||||
).scale(2)
|
||||
text2 = (
|
||||
OpenGLText(string.ascii_uppercase, stroke_width=4, stroke_color=BLUE)
|
||||
.scale(2)
|
||||
.next_to(text, DOWN)
|
||||
)
|
||||
# self.add(text, text2)
|
||||
self.play(Write(text))
|
||||
self.play(Write(text2))
|
||||
self.interactive_embed()
|
||||
|
||||
|
||||
class GuiTest(Scene):
|
||||
def construct(self):
|
||||
mesh = get_plane_mesh(self.renderer.context)
|
||||
|
|
@ -390,7 +407,7 @@ class InteractiveDevelopment(Scene):
|
|||
# lines as if they were part of this construct method.
|
||||
# In particular, 'square', 'circle' and 'self' will all be
|
||||
# part of the local namespace in that terminal.
|
||||
self.embed()
|
||||
# self.embed()
|
||||
|
||||
# Try copying and pasting some of the lines below into
|
||||
# the interactive shell
|
||||
|
|
@ -400,10 +417,12 @@ class InteractiveDevelopment(Scene):
|
|||
self.play(Rotate(circle, 90 * DEGREES))
|
||||
self.play(circle.animate.shift(2 * RIGHT).scale(0.25))
|
||||
|
||||
# text = Text("""
|
||||
# text = Text(
|
||||
# """
|
||||
# In general, using the interactive shell
|
||||
# is very helpful when developing new scenes
|
||||
# """)
|
||||
# """
|
||||
# )
|
||||
# self.play(Write(text))
|
||||
|
||||
# # In the interactive shell, you can just type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue