Plotter.export_gltf(filename, inline_data=True, rotate_scene=True, save_normals=True)[source]#

Export the current rendering scene as a glTF file.

Visit for an online viewer.

See for limitations regarding the exporter.


Path to export the gltf file to.

inline_databool, default: True

Sets if the binary data be included in the json file as a base64 string. When True, only one file is exported.

rotate_scenebool, default: True

Rotate scene to be compatible with the glTF specifications.

save_normalsbool, default: True

Saves the point array 'Normals' as 'NORMAL' in the outputted scene.


The VTK exporter only supports pyvista.PolyData datasets. If the plotter contains any non-PolyData datasets, these will be converted in the plotter, leading to a copy of the data internally.


Output a simple point cloud represented as balls.

>>> import numpy as np
>>> import pyvista as pv
>>> rng = np.random.default_rng(seed=0)
>>> point_cloud = rng.random((100, 3))
>>> pdata = pv.PolyData(point_cloud)
>>> pdata['orig_sphere'] = np.arange(100)
>>> sphere = pv.Sphere(radius=0.02)
>>> pc = pdata.glyph(scale=False, geom=sphere, orient=False)
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(
...     pc,
...     cmap='reds',
...     smooth_shading=True,
...     show_scalar_bar=False,
... )
>>> pl.export_gltf('balls.gltf')  

Output the orientation plotter.

>>> from pyvista import demos
>>> pl = demos.orientation_plotter()
>>> pl.export_gltf('orientation_plotter.gltf')