ManimCommunity / ManimCommunity/manim

Line can be seen through vertex dots when using `~.get_line_graph()` in OpenGL

Open
#2,006 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug opengl
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

Description of bug / unexpected behavior

When drawing a line graph with vertex dots using the OpenGL renderer, the line is visible through the vertex dots:

LineGraphExample_ManimCE_v0 10 0_OpenGL

Now compare this to the Cairo-rendered version:

LineGraphExample_ManimCE_v0 10 0_Cairo

The lines are behind the vertex dots, as they should be.

Expected behavior

The vertex dots should fully cover the lines.

How to reproduce the issue

Code for reproducing the problem
from manim import *

class LineGraphExample(Scene):
    def construct(self):
        plane = NumberPlane(
            x_range = (0, 7),
            y_range = (0, 5),
            x_length = 7,
            axis_config={"include_numbers": True},
        )
        plane.center()
        line_graph = plane.get_line_graph(
            x_values = [0, 1.5, 2, 2.8, 4, 6.25],
            y_values = [1, 3, 2.25, 4, 2.5, 1.75],
            line_color=RED,
            vertex_dot_style=dict(stroke_width=3,  fill_color=BLUE),
            stroke_width = 4,
        )
        self.play(Create(VGroup(plane, line_graph)))
        self.wait(1)

System specifications

System Details
  • OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)): Ubuntu 21.04
  • RAM: 32GB
  • Python version (python/py/python3 --version): 3.9.5
  • Installed modules (provide output from pip list):
Package                 Version
----------------------- ---------------------
manim                   0.10.0
moderngl                5.6.4
moderngl-window         2.4.0

Additional comments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided LineGraphExample with the OpenGL renderer and trace the implementation of get_line_graph(), especially how its lines and vertex dots are created and layered. Done means the vertex dots fully cover the lines at each vertex in OpenGL, matching the Cairo-rendered result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.