pyvista.Light.set_direction_angle#
- Light.set_direction_angle(elev, azim)[source]#
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 thatelevis the conventional elevation andazimis the conventional azimuth. In particular:elev = 0,azim = 0is the +x directionelev = 0,azim = 90is the +y directionelev = 90,azim = 0is the +z direction
- Parameters:
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)