Skip to content

Commit

Permalink
Port all of SurfaceExample
Browse files Browse the repository at this point in the history
eulertour committed Feb 27, 2021
1 parent b406300 commit 63184f8
Showing 3 changed files with 5 additions and 28 deletions.
24 changes: 0 additions & 24 deletions example_scenes/basic.py
Original file line number Diff line number Diff line change
@@ -2,10 +2,6 @@

from manim import *

if config["use_opengl_renderer"]:
from manim.opengl import *


# To watch one of these scenes, run the following:
# python --quality m manim example_scenes.py SquareToCircle -p
#
@@ -18,26 +14,6 @@
# for a 1920x1080 video)


class Testing(Scene):
def construct(self):
c = OpenGLLine(LEFT, RIGHT)
c2 = OpenGLLine(LEFT, RIGHT)
print(c.data["points"])
c2.shift(RIGHT)
self.play(Transform(c, c2))

# c = OpenGLDashedLine(LEFT, RIGHT)
# c2 = OpenGLDashedLine(LEFT, RIGHT)
# print(c.data["points"])
# c2.shift(RIGHT)
# self.play(Transform(c, c2))

# mob = ArcBetweenPoints(LEFT, RIGHT)
# mob2 = ArcBetweenPoints(LEFT, RIGHT)
# mob2.shift(RIGHT)
# self.play(Transform(mob, mob2), run_time=0.3)


class OpeningManim(Scene):
def construct(self):
title = Tex(r"This is some \LaTeX")
8 changes: 4 additions & 4 deletions manim/mobject/opengl_mobject.py
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ def __init__(
# self.init_event_listners()
self.init_points()
self.init_colors()
# self.init_shader_data()
self.init_shader_data()

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

def read_data_to_shader(self, shader_data, shader_data_key, data_key):
if data_key in self.locked_data_keys:
1 change: 1 addition & 0 deletions manim/renderer/opengl_renderer.py
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
rotation_matrix_transpose,
angle_of_vector,
)
from ..utils.simple_functions import clip

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

0 comments on commit 63184f8

Please sign in to comment.