Follower#

class Follower(*args, **kwargs)[source]#

Wrap vtkFollower.

A Follower is a subclass of Actor that always faces the camera. It is useful for screen-aligned labels and billboarding effects.

The Follower maintains the position and scale of the actor but updates its orientation continuously to face the camera.

Parameters:
mapperpyvista.DataSetMapper, optional

Mapper used to render the actor’s mesh.

proppyvista.Property, optional

Property of the actor.

namestr, optional

The name of this actor used when tracking on a plotter.

Examples#

Download Python source code | Download Jupyter notebook

Create a scene with a Follower text that always faces the camera and a transparent cube.

>>> import pyvista as pv
>>> from pyvista import examples
>>> pl = pv.Plotter()

Create the “Hello” text that will follow the camera.

>>> text_mesh = pv.Text3D('Hello', depth=0.1)
>>> text_mesh = text_mesh.translate(
...     [-text_mesh.center[0], -text_mesh.center[1], 0]
... )

Create mapper and follower actor for the text.

Create a transparent cube that doesn’t follow the camera.

>>> cube = pv.Cube()
>>> cube_actor = pl.add_mesh(
...     cube, color='MidnightBlue', opacity=0.3, show_edges=False
... )

Set the follower’s camera and show the scene.

../../../_images/pyvista-Follower-f51d8c10ffadf7ef_00_00.png

Attributes#

Follower.camera

Return or set the camera of this follower.

Inherited Attributes#

Actor.backface_prop

Return or set the backface property.

Prop3D.bounds

Return the bounds of the entity.

_BoundsSizeMixin.bounds_size

Return the size of each axis of the object’s bounding box.

Prop3D.center

Return the center of the entity.

Actor.force_opaque

Return or set actor opacity behavior.

Prop3D.length

Return the length of the entity.

Actor.mapper

Return or set the mapper of the actor.

Actor.memory_address

Return the memory address of this actor.

_NameMixin.name

Get or set the unique name identifier used by PyVista.

Prop3D.orientation

Return or set the entity orientation angles.

Prop3D.origin

Return or set the entity origin.

Actor.pickable

Return or set actor pickability.

Prop3D.position

Return or set the entity position.

Actor.prop

Return or set the property of this actor.

Prop3D.scale

Return or set entity scale.

Actor.texture

Return or set the actor texture.

Actor.use_bounds

Return or set the use of actor’s bounds.

Prop3D.user_matrix

Return or set the user matrix.

Actor.visibility

Return or set actor visibility.

Inherited Methods#

Actor.add_shader_replacement

Add a GLSL shader replacement to this actor.

Actor.clear_point_sprite_shape

Clear the custom point sprite shape.

Actor.clear_shader_replacements

Clear shader replacements from this actor.

Actor.copy

Create a copy of this actor.

Actor.disable_maximum_intensity_projection

Disable maximum intensity projection.

Actor.enable_maximum_intensity_projection

Enable maximum intensity projection.

Actor.plot

Plot just the actor.

Prop3D.rotate_x

Rotate the entity about the x-axis.

Prop3D.rotate_y

Rotate the entity about the y-axis.

Prop3D.rotate_z

Rotate the entity about the z-axis.

Prop3D.rotation_from

Set the entity’s orientation from a rotation.

Actor.set_point_sprite_shape

Set a custom point sprite shape via fragment shader.

Prop3D.transform

Apply a transformation to this object’s user_matrix.