Skip to content

Commit 63184f8

Browse files
committed
Port all of SurfaceExample
1 parent b406300 commit 63184f8

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed

example_scenes/basic.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
from manim import *
44

5-
if config["use_opengl_renderer"]:
6-
from manim.opengl import *
7-
8-
95
# To watch one of these scenes, run the following:
106
# python --quality m manim example_scenes.py SquareToCircle -p
117
#
@@ -18,26 +14,6 @@
1814
# for a 1920x1080 video)
1915

2016

21-
class Testing(Scene):
22-
def construct(self):
23-
c = OpenGLLine(LEFT, RIGHT)
24-
c2 = OpenGLLine(LEFT, RIGHT)
25-
print(c.data["points"])
26-
c2.shift(RIGHT)
27-
self.play(Transform(c, c2))
28-
29-
# c = OpenGLDashedLine(LEFT, RIGHT)
30-
# c2 = OpenGLDashedLine(LEFT, RIGHT)
31-
# print(c.data["points"])
32-
# c2.shift(RIGHT)
33-
# self.play(Transform(c, c2))
34-
35-
# mob = ArcBetweenPoints(LEFT, RIGHT)
36-
# mob2 = ArcBetweenPoints(LEFT, RIGHT)
37-
# mob2.shift(RIGHT)
38-
# self.play(Transform(mob, mob2), run_time=0.3)
39-
40-
4117
class OpeningManim(Scene):
4218
def construct(self):
4319
title = Tex(r"This is some \LaTeX")

manim/mobject/opengl_mobject.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595
# self.init_event_listners()
9696
self.init_points()
9797
self.init_colors()
98-
# self.init_shader_data()
98+
self.init_shader_data()
9999

100100
if self.depth_test:
101101
self.apply_depth_test()
@@ -1439,9 +1439,9 @@ def check_data_alignment(self, array, data_key):
14391439
def get_resized_shader_data_array(self, length):
14401440
# If possible, try to populate an existing array, rather
14411441
# than recreating it each frame
1442-
if len(self.shader_data) != length:
1443-
self.shader_data = resize_array(self.shader_data, length)
1444-
return self.shader_data
1442+
points = self.data["points"]
1443+
shader_data = np.zeros(len(points), dtype=self.shader_dtype)
1444+
return shader_data
14451445

14461446
def read_data_to_shader(self, shader_data, shader_data_key, data_key):
14471447
if data_key in self.locked_data_keys:

manim/renderer/opengl_renderer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
rotation_matrix_transpose,
1818
angle_of_vector,
1919
)
20+
from ..utils.simple_functions import clip
2021

2122
from ..mobject import opengl_geometry
2223
from ..mobject.opengl_mobject import OpenGLMobject, OpenGLPoint

0 commit comments

Comments
 (0)