world_focal_point

property Light.world_focal_point

Return the world space focal point of the light.

The world space focal point is the focal_point property transformed by the light’s transform matrix if it exists. The value of this read-only property corresponds to the vtk.vtkLight.GetTransformedFocalPoint() method.

Examples

Create a light with a transformation matrix that corresponds to a 90-degree rotation around the z axis and a shift by (0, 0, -1), and check that the light’s focal point transforms as expected.

>>> import numpy as np
>>> import pyvista as pv
>>> light = pv.Light(focal_point=(1, 0, 3))
>>> trans = np.zeros((4, 4))
>>> trans[:-1, :-1] = [[0, -1, 0], [1, 0, 0], [0, 0, 1]]
>>> trans[:-1, -1] = [0, 0, -1]
>>> light.transform_matrix = trans
>>> light.focal_point
(1.0, 0.0, 3.0)
>>> light.world_focal_point
(0.0, 1.0, 2.0)