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:
- mapper
pyvista.DataSetMapper,optional Mapper used to render the actor’s mesh.
- prop
pyvista.Property,optional Property of the actor.
- name
str,optional The name of this actor used when tracking on a plotter.
- mapper
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.
>>> text_mapper = pv.DataSetMapper(text_mesh)
>>> follower = pv.Follower(mapper=text_mapper)
>>> follower.prop.color = 'gold'
>>> _ = pl.add_actor(follower)
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.
>>> follower.camera = pl.camera
>>> pl.show()
Attributes#
Return or set the camera of this follower. |
Inherited Attributes#
Return or set the backface property. |
|
Return the bounds of the entity. |
|
Return the size of each axis of the object’s bounding box. |
|
Return the center of the entity. |
|
Return or set actor opacity behavior. |
|
Return the length of the entity. |
|
Return or set the mapper of the actor. |
|
Return the memory address of this actor. |
|
Get or set the unique name identifier used by PyVista. |
|
Return or set the entity orientation angles. |
|
Return or set the entity origin. |
|
Return or set actor pickability. |
|
Return or set the entity position. |
|
Return or set the property of this actor. |
|
Return or set entity scale. |
|
Return or set the actor texture. |
|
Return or set the use of actor’s bounds. |
|
Return or set the user matrix. |
|
Return or set actor visibility. |
Inherited Methods#
Add a GLSL shader replacement to this actor. |
|
Clear the custom point sprite shape. |
|
Clear shader replacements from this actor. |
|
Create a copy of this actor. |
|
Disable maximum intensity projection. |
|
Enable maximum intensity projection. |
|
Plot just the actor. |
|
Rotate the entity about the x-axis. |
|
Rotate the entity about the y-axis. |
|
Rotate the entity about the z-axis. |
|
Set the entity’s orientation from a rotation. |
|
Set a custom point sprite shape via fragment shader. |
|
Apply a transformation to this object’s |