Skip to content

Interactive IPython Terminal does not increase the phi value more than 90 degrees #2496

Open
@nveshaan

Description

@nveshaan

Description of bug / unexpected behaviour

When using the interactive ipython terminal (using self.interactive_embed() function and OpenGL renderer), the phi(polar angle) value for the orientation of the camera does not increase beyond 90 DEGREES or decrease below -90 DEGREES. Note that the theta(azimuthal angle) value does increase beyond 90 DEGREES.

But when using (in interactive mode) self.move_camera(phi=100 * DEGREES, theta=100 * DEGREES), the camera does move to an orientation that has a phi value more than 90 DEGREES.

It is only during the 'manual change of view' (or change in orientation of camera) in interactive mode, that the phi value was not increasing beyond 90 DEGREES.

issue.mp4

Expected behaviour

The below video shows the expected behaviour which was rendered using self.move_camera(phi=120 * DEGREES, theta=30 * DEGREES). Here, the phi(polar angle) value has increased more than 90 DEGREES, which was not happening during the manual change of view in interactive mode.

expected_behaviour.mp4

How to reproduce the issue

Code for reproducing the problem
from manim import *

class ThreeDCameraRotation(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        circle=Circle()
        lab = axes.get_z_axis_label(Tex("$z$-label"))
        self.set_camera_orientation(phi=50 * DEGREES, theta=30 * DEGREES)
        self.add(circle,axes, lab)
        self.interactive_embed()

NOTE: you have to add --renderer=opengl flag

Additional media files

Images/GIFs

Logs

Terminal output
Manim Community v0.14.0

Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: 

log

System specifications

System Details
  • OS: Linux Mint 20.3 x86_64
  • RAM: 7.5 GiB
  • Python version: Python 3.8.10
  • Installed modules:
Package                   Version             
------------------------- --------------------
apt-clone                 0.2.1               
apturl                    0.5.2               
argon2-cffi               21.3.0              
argon2-cffi-bindings      21.2.0              
asttokens                 2.0.5               
attrs                     19.3.0              
backcall                  0.2.0               
beautifulsoup4            4.8.2               
black                     21.12b0             
bleach                    4.1.0               
blessings                 1.7                 
blinker                   1.4                 
bpytop                    1.0.68              
Brlapi                    0.7.0               
certifi                   2019.11.28          
cffi                      1.15.0              
chanim                    1.0.2.1             
chardet                   3.0.4               
click                     8.0.3               
click-default-group       1.2.2               
cloup                     0.7.1               
colorama                  0.4.3               
colour                    0.1.5               
command-not-found         0.3                 
commonmark                0.9.1               
configobj                 5.0.6               
cryptography              2.8                 
cssselect                 1.1.0               
cupshelpers               1.0                 
cycler                    0.10.0              
dbus-python               1.2.16              
debugpy                   1.5.1               
decorator                 5.1.1               
defer                     1.0.6               
defusedxml                0.7.1               
distlib                   0.3.4               
distro                    1.4.0               
dnspython                 1.16.0              
entrypoints               0.3                 
executing                 0.8.2               
filelock                  3.4.2               
glcontext                 2.3.4               
gpustat                   0.6.0               
grpcio                    1.16.1              
html5lib                  1.0.1               
httplib2                  0.14.0              
idna                      2.8                 
ifaddr                    0.1.6               
IMDbPY                    6.8                 
importlib-metadata        1.5.0               
ipykernel                 6.7.0               
ipython                   8.0.0               
ipython-genutils          0.2.0               
ipywidgets                7.6.5               
isosurfaces               0.1.0               
jedi                      0.18.1              
Jinja2                    3.0.3               
jsonschema                3.2.0               
jupyter                   1.0.0               
jupyter-client            7.1.1               
jupyter-console           6.4.0               
jupyter-core              4.9.1               
jupyterlab-pygments       0.1.2               
jupyterlab-widgets        1.0.2               
keyring                   18.0.1              
kiwisolver                1.0.1               
kociemba-manim-rubikscube 0.0.1               
launchpadlib              1.10.13             
lazr.restfulclient        0.14.2              
lazr.uri                  1.0.3               
louis                     3.12.0              
lxml                      4.5.0               
macaroonbakery            1.3.1               
Mako                      1.1.0               
manim                     0.14.0              
manim-physics             0.2.3               
manim-rubikscube          0.1.0               
ManimPango                0.4.0.post0         
mapbox-earcut             0.12.11             
Markdown                  3.1.1               
MarkupSafe                2.0.1               
matplotlib                3.1.2               
matplotlib-inline         0.1.3               
mistune                   0.8.4               
mock                      3.0.5               
moderngl                  5.6.4               
moderngl-window           2.4.1               
more-itertools            4.2.0               
multipledispatch          0.6.0               
mypy-extensions           0.4.3               
nbclient                  0.5.10              
nbconvert                 6.4.0               
nbformat                  5.1.3               
nemo-emblems              5.2.0               
nest-asyncio              1.5.4               
netaddr                   0.7.19              
netifaces                 0.10.4              
networkx                  2.6.3               
notebook                  6.4.7               
numpy                     1.17.4              
nvidia-ml-py3             7.352.0             
oauthlib                  3.1.0               
onboard                   1.4.1               
packaging                 20.3                
PAM                       0.4.2               
pandocfilters             1.5.0               
parso                     0.8.3               
pathspec                  0.9.0               
pbr                       5.4.5               
pexpect                   4.6.0               
pickleshare               0.7.5               
Pillow                    7.0.0               
pip                       20.0.2              
platformdirs              2.4.1               
prometheus-client         0.12.0              
prompt-toolkit            3.0.24              
protobuf                  3.6.1               
psutil                    5.9.0               
ptyprocess                0.7.0               
pure-eval                 0.2.1               
PyAudio                   0.2.11              
pycairo                   1.20.1              
pycparser                 2.21                
pycrypto                  2.6.1               
pycups                    1.9.73              
pycurl                    7.43.0.2            
pydub                     0.25.1              
pyglet                    1.5.21              
Pygments                  2.3.1               
PyGObject                 3.36.0              
PyICU                     2.4.2               
pyinotify                 0.9.6               
PyJWT                     1.7.1               
pymacaroons               0.13.0              
pymunk                    6.2.1               
PyNaCl                    1.3.0               
pyparsing                 2.4.6               
pyparted                  3.11.2              
PyQt5                     5.14.1              
PyQtWebEngine             5.14.0              
pyRFC3339                 1.1                 
pyrr                      0.10.3              
pyrsistent                0.15.5              
python-apt                2.0.0+ubuntu0.20.4.6
python-dateutil           2.7.3               
python-debian             0.1.36ubuntu1       
python-magic              0.4.16              
python-xapp               2.2.1               
python-xlib               0.23                
pytz                      2019.3              
pyxdg                     0.26                
PyYAML                    5.3.1               
pyzmq                     22.3.0              
qtconsole                 5.2.2               
QtPy                      1.9.0               
reportlab                 3.5.34              
requests                  2.22.0              
requests-file             1.4.3               
requests-unixsocket       0.2.0               
rich                      11.0.0              
scipy                     1.7.3               
scour                     0.37                
screeninfo                0.6.7               
SecretStorage             2.3.1               
Send2Trash                1.8.0               
setproctitle              1.1.10              
setuptools                45.2.0              
simplejson                3.16.0              
sip                       4.19.21             
six                       1.14.0              
skia-pathops              0.7.2               
soupsieve                 1.9.5               
srt                       3.5.0               
stack-data                0.1.3               
systemd-python            234                 
terminado                 0.12.1              
testpath                  0.5.0               
tinycss2                  1.0.2               
tldextract                2.2.1               
tomli                     1.2.3               
tornado                   6.1                 
tqdm                      4.62.3              
traitlets                 5.1.1               
typing-extensions         4.0.1               
ubuntu-drivers-common     0.0.0               
ufw                       0.36                
Unidecode                 1.1.1               
urllib3                   1.25.8              
virtualenv                20.13.0             
wadllib                   1.3.3               
watchdog                  2.1.6               
wcwidth                   0.2.5               
webencodings              0.5.1               
wheel                     0.34.2              
widgetsnbextension        3.5.2               
xkit                      0.0.0               
xlrd                      1.1.0               
youtube-dl                2021.4.26           
zipp                      1.0.0
LaTeX details
  • LaTeX distribution: MikTeX
  • Installed LaTeX packages:
FFMPEG

Output of ffmpeg -version:

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issuesopenglConcerning the OpenGL renderer.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions