.. 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() .. 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() .. _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 `_