ManimCommunity / ManimCommunity/manim
Opengl distortion issue in the nudging example of VectorField
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
In the nudging example in of VectorField, parts of the circles go in and out of view and gets distorted when using opengl.
Cairo:
https://user-images.githubusercontent.com/32387857/128901100-d0781ad9-32c1-478b-a0c7-051eb329c964.mp4
Opengl:
https://user-images.githubusercontent.com/32387857/128900954-6d789384-bf12-4b92-bf7b-5b1323979967.mp4
## Expected behavior
Expect it to be the same as cairo with no distortion
## How to reproduce the issue
Code for reproducing the problem
```py
class Nudging(Scene):
def construct(self):
func = lambda pos: np.sin(pos[1] / 2) * RIGHT + np.cos(pos[0] / 2) * UP
vector_field = ArrowVectorField(func, delta_x=1, delta_y=1, length_func=lambda x: x / 2)
self.add(vector_field)
circle = Circle(radius=2).shift(LEFT)
self.add(circle.copy().set_color(GRAY))
dot = Dot().move_to(circle)
vector_field.nudge(circle, -2, 60, True)
vector_field.nudge(dot, -2, 60)
circle.add_updater(vector_field.get_nudge_updater(pointwise=True))
dot.add_updater(vector_field.get_nudge_updater())
self.add(circle, dot)
self.wait(6)
```
## 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:
FFMPEG
Output of `ffmpeg -version`:
```
PASTE HERE
```
## Additional comments
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 with the provided Nudging scene and run it with both OpenGL and Cairo, focusing on ArrowVectorField.nudge and the circle and dot updaters. Compare the rendered motion and trace the OpenGL-specific distortion; done means the OpenGL result matches Cairo without parts of the circle leaving view or becoming distorted.
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