ManimCommunity / ManimCommunity/manim

OpenGL `Transform`ing part of a `(Math)Tex` causes unexpected behavior relative to Cairo

Open
#2,153 5 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

Consider the following scene:
```python
class Test(Scene):
def construct(self):
t1 = Tex("b")
t2 = Tex("a", "b")
t1.scale(5)
t2.scale(5)
t1.move_to(t2[1].get_center())
self.add(t1)
self.wait()
self.play(Transform(t1, t2[1]))
self.wait()
```
When rendered with Cairo, it works as expected: the b just sits there unmoving the whole time. However, when rendered with OpenGL, this happens:

https://user-images.githubusercontent.com/20936595/135917297-baf2526e-081b-478b-b8e7-6d7de11044de.mp4

Somehow manim doesn't recognize that the b in each case is the same and one of them shrinks to nothing while the other one grows from nothing. This is not the desired behavior when trying to create clean animations combining parts of equations.

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 Test scene with both Cairo and OpenGL, focusing on Tex, Transform, and the two matching b glyphs. Compare how each renderer identifies and interpolates the corresponding parts; done means the OpenGL rendering keeps the b stationary, matching Cairo's behavior, while preserving the intended equation animation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.