Cone doesn't initialize OpenglVMobject

This commit is contained in:
Tristan Schulz 2024-11-26 07:14:00 +01:00
commit 91a6bf0658
No known key found for this signature in database
GPG key ID: BA691DECF9CB812A
5 changed files with 14 additions and 6 deletions

9
example_scenes/bench.py Normal file
View file

@ -0,0 +1,9 @@
from manim import *
class Test(Scene):
def construct(scene):
scene.camera.set_euler_angles(phi=75 * DEGREES, theta=-45 * DEGREES)
text = Tex("This is a 3D tex").fix_in_frame()
scene.add(text)
scene.wait()

View file

@ -144,6 +144,7 @@ class OpenGLMobject:
is_fixed_orientation: bool = False,
depth_test: bool = True,
name: str | None = None,
**kwargs, # just dump
):
self.color = color
self.opacity = opacity

View file

@ -19,6 +19,7 @@ from manim.utils.space_ops import normalize_along_axis
__all__ = ["OpenGLSurface", "OpenGLTexturedSurface"]
# TODO: Those will not work in the current state we will have to think about a different method to render these with shaders in our current pipeline
class OpenGLSurface(OpenGLMobject):
r"""Creates a Surface.
@ -57,7 +58,6 @@ class OpenGLSurface(OpenGLMobject):
("dv_point", np.float32, (3,)),
("color", np.float32, (4,)),
]
shader_folder = "surface"
def __init__(
self,
@ -81,7 +81,6 @@ class OpenGLSurface(OpenGLMobject):
epsilon=1e-5,
render_primitive=moderngl.TRIANGLES,
depth_test=True,
shader_folder=None,
**kwargs,
):
self.passed_uv_func = uv_func
@ -105,8 +104,6 @@ class OpenGLSurface(OpenGLMobject):
opacity=opacity,
gloss=gloss,
shadow=shadow,
shader_folder=shader_folder if shader_folder is not None else "surface",
render_primitive=render_primitive,
depth_test=depth_test,
**kwargs,
)

View file

@ -95,6 +95,8 @@ class OpenGLVMobject(OpenGLMobject):
long_lines: bool = False,
joint_type: LineJointType = LineJointType.AUTO,
flat_stroke: bool = False,
shade_in_3d=False, # TODO: Can be ignored for now but we should think about using some sort of shader to introduce lighting after deferred rendering has completed
checkerboard_colors=False, # ignore,
**kwargs: Unpack[MobjectKwargs],
):
super().__init__(**kwargs)

View file

@ -618,8 +618,7 @@ class Cone(Surface):
self._current_phi = 0
self.base_circle = Circle(
radius=base_radius,
color=self.fill_color,
fill_opacity=self.fill_opacity,
color=self.get_fill_colors(),
stroke_width=0,
)
self.base_circle.shift(height * IN)