set_direction_angle

Light.set_direction_angle(elev, azim)

Set the position and focal point of a directional light.

The light is switched to directional (non-positional). The focal point is set to the origin. The position is defined in terms of an elevation and an azimuthal angle, both in degrees.

Note that the equivalent vtk.vtkLight.SetDirectionAngle() method uses a surprising coordinate system where the (x’, y’, z’) axes of the method correspond to the (z, x, y) axes of the renderer. This method reimplements the functionality in a way that elev is the conventional elevation and azim is the conventional azimuth. In particular:

  • elev = 0, azim = 0 is the +x direction

  • elev = 0, azim = 90 is the +y direction

  • elev = 90, azim = 0 is the +z direction

Parameters
elevfloat

The elevation of the directional light.

azimfloat

The azimuthal angle of the directional light.

Examples

Create a light that shines on the origin from a 30-degree elevation in the xz plane.

>>> import pyvista as pv
>>> light = pv.Light()
>>> light.set_direction_angle(30, 0)