ManimCommunity / ManimCommunity/manim

Why do self.set_camera_orientation() and self.move_camera() produce different results?

Open
#4,862 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

I'm trying to understand why `self.set_camera_orientation()` and `self.move_camera()` produce different final camera views, even when I pass exactly the same camera parameters (phi, theta, frame_center, zoom, etc.) in a ThreeDScene.

I expected both methods to end up with the same final camera position and orientation, with the only difference being that move_camera() animates the transition. However, the final views are actually different.

```
from manim import *

class Test(ThreeDScene):
def construct(self):
sp = Sphere()

# Uncomment this and comment out move_camera()
# self.set_camera_orientation(
# phi=80 * DEGREES,
# theta=-50 * DEGREES,
# frame_center=[0, 0, 3] - 3 * UR,
# zoom=0.9,
# )

self.add(sp)

self.move_camera(
phi=80 * DEGREES,
theta=-50 * DEGREES,
frame_center=[0, 0, 3] - 3 * UR,
zoom=0.9,
)

self.wait()
```
If I replace move_camera() with set_camera_orientation() using exactly the same parameters, I get a different final view of the scene. There's another confusing issue: when I use `self.move_camera()` and render with the -s flag, the saved final frame doesn't match the final frame I get when rendering without -s. I would have expected them to be identical

Could someone explain why this happens? Is this expected behavior, or is it a bug?

Image

https://github.com/user-attachments/assets/51ce431d-a8ca-4b6b-abf3-5f31e9dc9762

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied ThreeDScene example with both set_camera_orientation() and move_camera(), including renders with and without the -s flag. Compare the implementations and final camera state after each path; done means the differing views are explained and the behavior is either made consistent or clearly documented as expected.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.