.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/01_introductory/viz_texture.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_auto_examples_01_introductory_viz_texture.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_01_introductory_viz_texture.py:


===============
Sphere Texture
===============
In this tutorial, we will show how to create a sphere with a texture.

.. GENERATED FROM PYTHON SOURCE LINES 7-10

.. code-block:: Python


    import fury








.. GENERATED FROM PYTHON SOURCE LINES 11-12

Create a scene to start.

.. GENERATED FROM PYTHON SOURCE LINES 12-15

.. code-block:: Python


    scene = fury.window.Scene()








.. GENERATED FROM PYTHON SOURCE LINES 16-20

Load an image (png, bmp, jpeg or jpg) using ``io.load_image``. In this
example, we will use ``read_viz_textures`` to access an image of the
Earth's surface from the fury Github after using ''fetch_viz_textures()''
to download the available textures.

.. GENERATED FROM PYTHON SOURCE LINES 20-25

.. code-block:: Python


    fury.data.fetch_viz_textures()
    filename = fury.data.read_viz_textures("1_earth_8k.jpg")
    image = fury.io.load_image(filename)





.. 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/skoudoro/.fury/textures 




.. GENERATED FROM PYTHON SOURCE LINES 26-30

Next, use ``fury.actor.texture_on_sphere`` to add a sphere with the texture from
your loaded image to the already existing scene.
To add a texture to your scene as visualized on a plane, use
``fury.actor.texture`` instead.

.. GENERATED FROM PYTHON SOURCE LINES 30-33

.. code-block:: Python


    scene.add(fury.actor.texture_on_sphere(image))








.. GENERATED FROM PYTHON SOURCE LINES 34-36

Lastly, record the scene, or set interactive to True if you would like to
manipulate your new sphere.

.. GENERATED FROM PYTHON SOURCE LINES 36-41

.. code-block:: Python


    interactive = False
    if interactive:
        fury.window.show(scene, size=(600, 600), reset_camera=False)
    fury.window.record(scene=scene, size=(900, 768), out_path="viz_texture.png")



.. image-sg:: /auto_examples/01_introductory/images/sphx_glr_viz_texture_001.png
   :alt: viz texture
   :srcset: /auto_examples/01_introductory/images/sphx_glr_viz_texture_001.png
   :class: sphx-glr-single-img






.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 6.610 seconds)


.. _sphx_glr_download_auto_examples_01_introductory_viz_texture.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: viz_texture.ipynb <viz_texture.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: viz_texture.py <viz_texture.py>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_