ManimCommunity / ManimCommunity/manim
OpenGL `Transform`ing part of a `(Math)Tex` causes unexpected behavior relative to Cairo
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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