.. _animations-plots: Animations ========================================================================================= Animations can be created by frame varying geometry, color, and orientation. As demonstrated in most of these examples, code development is primarily the frame sequence algorithms, whereas minimal development is needed for surface creation using S3Dlib. The following examples were constructed using Matplotlib `FuncAnimation `_ . Final conversion to animated png file format used `ezGIF `_ with the temporary frame files generated by the *writer* in the call to *anin.save*. Rotation visualizations ---------------------------------------------------------------------------------------- A surface may be perceived as rotating either by: * Method 0: changing the viewing direction, or * Method 1: changing the viewing and lighting directions, or * Method 2: only rotational transforms of the surface with a constant lighting direction. These can produce identical 'stationary viewer' results. Method 2 is used if additional objects in the visualization need to be stationary. A 'stationary object' will be perceived when only the viewing direction is changed, leaving the lighting direction unchanged. For methods 1 and 2, the object needs to change geometry and color per frame. This requires the 'old' object to be removed from the axes, then the 'new' objects added to the axes for each frame. .. toctree:: :hidden: animations/anim_bases.rst .. raw:: html
Method 1 - axis view controlling color .. only:: html .. image:: animations/images/static_bases.png :class: docfig Platonic Solids .. raw:: html
.. toctree:: :hidden: animations/anim_earth_moon.rst .. raw:: html
Method 2 - stationary moon .. only:: html .. image:: animations/images/static_earth_moon.png :class: docfig Moon with Rotating Earth .. raw:: html
.. toctree:: :hidden: animations/anim_retinal_scan.rst .. raw:: html
Method 0 - Stationary object with rotation of the view .. only:: html .. image:: animations/images/static_retinal_scan.png :class: docfig Retinal Scan .. raw:: html
.. toctree:: :hidden: animations/anim_lab_rot.rst .. raw:: html
Method 2 - stationary background axis planes .. only:: html .. image:: animations/images/static_lab_rot.png :class: docfig Lab Color Space .. raw:: html
.. toctree:: :hidden: animations/anim_cmap_rot.rst .. raw:: html
Method 2 - stationary background axis planes .. only:: html .. image:: animations/images/static_cmap_rot.png :class: docfig Cmap in Lab Space .. raw:: html
.. toctree:: :hidden: animations/anim_wturbine.rst .. raw:: html
Method 2 - object rotation about the Y-axis. .. only:: html .. image:: animations/images/static_wturbine.png :class: docfig Wind Turbine .. raw:: html
.. toctree:: :hidden: animations/anim_pycube.rst .. raw:: html
Method 1 - axis view controlling shading and highlighting .. only:: html .. image:: animations/images/static_pycube.png :class: docfig Python Cube .. raw:: html
.. toctree:: :hidden: animations/anim_fig_8_knot.rst .. raw:: html

Method 1 - axis view controlling surface color
.. only:: html .. image:: animations/images/static_fig_8_knot.png :class: docfig .. raw:: html ▨
Dual Surface Face Color
.. raw:: html
Parametric Surface Transforms ------------------------------------------------------------------------------------------- The following are examples of transformations between two 3D surfaces via a single parameter. .. toctree:: :hidden: animations/anim_cat2heli.rst .. raw:: html

Parametric changes between a catenoid to helicoid surface.
.. only:: html .. image:: animations/images/static_cat2heli.png :class: docfig .. raw:: html ▨
Catenoid to Helicoid
.. toctree:: :hidden: animations/anim_klein.rst .. raw:: html
Visualization of (θ,Z) → (x,y,z) .. only:: html .. image:: animations/images/static_klein.png :class: docfig Cylinder to Klein Bottle .. raw:: html
.. toctree:: :hidden: animations/anim_boy2roman_contours.rst .. raw:: html
Parametric changes between the Boy and Roman surface spherical contours. .. only:: html .. image:: animations/images/static_boy2roman_contours.png :class: docfig Boy to Roman Contour Animation .. raw:: html
.. toctree:: :hidden: animations/anim_rgb_lab_hsv.rst .. raw:: html
Surface transformations among RGB, Lab and HSV color spaces. .. only:: html .. image:: animations/images/static_rgb_lab_hsv.png :class: docfig RGB to Lab to HSV .. raw:: html
.. raw:: html
Function Parameters ------------------------------------------------------------------------------------------- Single or multiple function parameters defining surface geometry are varied during the sequence of animation frames. .. toctree:: :hidden: animations/anim_tube_disp.rst .. raw:: html
Geometric surface animation producing a vibrating cylinder. .. only:: html .. image:: animations/images/static_tube_disp.png :class: docfig Time Sequence Animation .. raw:: html
.. toctree:: :hidden: animations/anim_hypercube.rst .. raw:: html
Rotations of a hypercube. .. only:: html .. image:: animations/images/static_hypercube.png :class: docfig Hypercube Animation .. raw:: html
.. toctree:: :hidden: animations/anim_conic.rst .. raw:: html
Transition of planar contours on a surface. .. only:: html .. image:: animations/images/static_conic.png :class: docfig Conic Sections .. raw:: html
.. toctree:: :hidden: animations/anim_dini.rst .. raw:: html

Continuous changes in multiple surface parameters.
.. only:: html .. image:: animations/images/static_dini.png :class: docfig .. raw:: html ▨
Dini Surface Animation
.. toctree:: :hidden: animations/anim_complex.rst .. raw:: html
Animation of a complex number taken to a whole or fractional power. .. only:: html .. image:: animations/images/static_complex.png :class: docfig Complex Number to a Power .. raw:: html
.. toctree:: :hidden: animations/anim_loop_cmap.rst .. raw:: html
Animation using colormap transparency to 'hide' a section of the geometry. .. only:: html .. image:: animations/images/static_loop_cmap.png :class: docfig Colormap Frame Animation .. raw:: html
.. raw:: html
Internal Volume Visualizations ------------------------------------------------------------------------------------------- Visualization of volume interiors are produced by combinations of sequentially mapping multiple surfaces and also sequentially clipping and translating surfaces. .. toctree:: :hidden: animations/anim_inner_earth.rst .. raw:: html

Annimated slices through a sphere.
.. only:: html .. image:: animations/images/static_inner_earth.png :class: docfig .. raw:: html ▨
Earth Interior
.. toctree:: :hidden: animations/anim_rgb_cube.rst .. raw:: html
Producing a 3D solid object slicing perception in RGB color space. .. only:: html .. image:: animations/images/static_rgb_cube.png :class: docfig RGB Mapping .. raw:: html
.. toctree:: :hidden: animations/anim_hsv_cylinder.rst .. raw:: html
Producing a 3D solid object slicing perception in HSV color space. .. only:: html .. image:: animations/images/static_hsv_cylinder.png :class: docfig HSV Mapping .. raw:: html