Skip to content

Depth of mobjects doesn't get calculated correctly when --renderer=opengl #4721

@Akshat-Mishra-py

Description

@Akshat-Mishra-py

Description of bug / unexpected behavior

The depth doesnt get calculated correctly when renderer is set to opengl.
The mobjects seems to be added to the depthbuffer according to their order of addition in the scene instead of their position relative to the camera.

Expected behavior

Expected Behaviour with cairo renderer:

m.mp4

Actual Behaviour with opengl renderer:

m.mp4

How to reproduce the issue

Code for reproducing the problem
from manim import *
from svgelements import Path
from random import random
class m(ThreeDScene):
    def construct(self) -> None:
        cubes = VGroup(*[
            Cube(fill_color=color, fill_opacity=1.0,stroke_width=1).move_to((0,0,-i*2))
            for i,color in enumerate([RED, BLUE, GREEN, ORANGE])])
        # self.camera.set_theta(-30*DEGREES)
        axes = ThreeDAxes()
        
        self.set_camera_orientation(PI/4, PI/4)
        self.play(Write(axes))
        self.play(Write(cubes), run_time = 5)
        self.wait()

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
PASTE HERE
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions