.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_demos/viz_skybox.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_04_demos_viz_skybox.py: =============== Adding a Skybox =============== This example demonstrates how to use the add a skybox to a scene in FURY. .. GENERATED FROM PYTHON SOURCE LINES 9-18 .. 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 19-20 Let's fetch a skybox texture from the FURY data repository. .. GENERATED FROM PYTHON SOURCE LINES 20-23 .. code-block:: Python fetch_viz_cubemaps() .. GENERATED FROM PYTHON SOURCE LINES 24-26 The following function returns the full path of the 6 images composing the skybox. .. GENERATED FROM PYTHON SOURCE LINES 26-29 .. code-block:: Python texture_files = read_viz_cubemap("skybox") .. GENERATED FROM PYTHON SOURCE LINES 30-32 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 32-35 .. code-block:: Python cube_map = load_cube_map_texture(texture_files) .. GENERATED FROM PYTHON SOURCE LINES 36-40 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 40-55 .. code-block:: Python scene = Scene(skybox=cube_map) sphere_actor = sphere( np.zeros((1, 3)), colors=(1, 0, 1, 1), radii=15.0, phi=48, theta=48, ) scene.add(sphere_actor) show_m = ShowManager(scene=scene, title="FURY Skybox Example") show_m.start() .. _sphx_glr_download_auto_examples_04_demos_viz_skybox.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: viz_skybox.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: viz_skybox.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: viz_skybox.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_