.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/01_introductory/viz_multi_screen.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_01_introductory_viz_multi_screen.py: ==================== Multi Screen Example ==================== This example demonstrates how to create a multi-screen setup using FURY's `ShowManager` and `Scene` classes. .. GENERATED FROM PYTHON SOURCE LINES 10-19 .. code-block:: Python import numpy as np from fury.window import ShowManager, Scene from fury.actor import sphere from fury.data import read_viz_cubemap, fetch_viz_cubemaps from fury.io import load_cube_map_texture .. GENERATED FROM PYTHON SOURCE LINES 20-21 Let's fetch a skybox texture from the FURY data repository. .. GENERATED FROM PYTHON SOURCE LINES 21-24 .. code-block:: Python fetch_viz_cubemaps() .. rst-class:: sphx-glr-script-out .. code-block:: none Dataset is already in place. If you want to fetch it again please first remove the folder /Users/maharshigor/.fury/cubemaps ({'skybox-nx.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-nx.jpg', '12B1CE6C91AA3AAF258A8A5944DF739A6C1CC76E89D4D7119D1F795A30FC1BF2'), 'skybox-ny.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-ny.jpg', 'E18FE2206B63D3DF2C879F5E0B9937A61D99734B6C43AC288226C58D2418D23E'), 'skybox-nz.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-nz.jpg', '00DDDD1B715D5877AF2A74C014FF6E47891F07435B471D213CD0673A8C47F2B2'), 'skybox-px.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-px.jpg', 'BF20ACD6817C9E7073E485BBE2D2CE56DACFF73C021C2B613BA072BA2DF2B754'), 'skybox-py.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-py.jpg', '16F0D692AF0B80E46929D8D8A7E596123C76729CC5EB7DFD1C9184B115DD143A'), 'skybox-pz.jpg': ('https://raw.githubusercontent.com/fury-gl/fury-data/master/cubemaps/skybox-pz.jpg', 'B850B5E882889DF26BE9289D7C25BA30524B37E56BC2075B968A83197AD977F3')}, '/Users/maharshigor/.fury/cubemaps') .. GENERATED FROM PYTHON SOURCE LINES 25-27 The following function returns the full path of the 6 images composing the skybox. .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python texture_files = read_viz_cubemap("skybox") .. GENERATED FROM PYTHON SOURCE LINES 31-33 Now that we have the location of the textures, let's load them and create a Cube Map Texture object. .. GENERATED FROM PYTHON SOURCE LINES 33-36 .. code-block:: Python cube_map = load_cube_map_texture(texture_files) .. GENERATED FROM PYTHON SOURCE LINES 37-41 The Scene object in FURY can handle cube map textures and extract light information from them, so it can be used to create more plausible materials interactions. The ``skybox`` parameter takes as input a cube map texture and performs the previously described process. .. GENERATED FROM PYTHON SOURCE LINES 41-46 .. code-block:: Python scene0 = Scene(skybox=cube_map) scene1 = Scene(background=(1, 1, 1, 1)) scene2 = Scene(background=(1, 0, 0, 1)) .. GENERATED FROM PYTHON SOURCE LINES 47-50 Let's create three different sphere actors to add to respective scenes. Note: Adding same actor to multiple scenes will not work and only add to the last scene that got the actor added to it. .. GENERATED FROM PYTHON SOURCE LINES 50-84 .. code-block:: Python sphere_actor0 = sphere( np.zeros((1, 3)), colors=(1, 0, 1, 1), radii=15.0, phi=48, theta=48, ) sphere_actor1 = sphere( np.zeros((1, 3)), colors=(1, 0, 1, 1), radii=15.0, phi=48, theta=48, ) sphere_actor2 = sphere( np.zeros((1, 3)), colors=(1, 0, 1, 1), radii=15.0, phi=48, theta=48, ) scene0.add(sphere_actor0) scene1.add(sphere_actor1) scene2.add(sphere_actor2) show_m = ShowManager( scene=[scene0, scene1, scene2], title="FURY Multi Screen Example", screen_config=[2, 1], ) show_m.start() .. image-sg:: /auto_examples/01_introductory/images/sphx_glr_viz_multi_screen_001.png :alt: viz multi screen :srcset: /auto_examples/01_introductory/images/sphx_glr_viz_multi_screen_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.289 seconds) .. _sphx_glr_download_auto_examples_01_introductory_viz_multi_screen.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: viz_multi_screen.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: viz_multi_screen.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: viz_multi_screen.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_