Skip to content

Follower

Introduction

vtkFollower is a subclass of Actor that always faces the camera.

You must set the camera before use. This class will update the matrix such that the follower always faces the camera. Sepcifically the y axis will up up, the Z axes will point to the camera and the x axis will point to the right. You may need to rotate, scale, position the follower to get your data oriented propoerly for this convention.

If useViewUp is set then instea dof using the camera's view up the follow's viewUp will be used. This is usefull in cases where you want up to be locked independent of the camera. This is typically the case for VR or AR annotations where the headset may tilt but text should continue to be relative to a constant view up vector.

Methods

computeMatrix

Generate the matrix based on ivars.

extend

Method use to decorate a given object (publicAPI+model) with vtkFollower characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIFollowerInitialValuesNo(default: {})

getCamera

Get the camera to follow.

getUseViewUp

Check whether the view up vector is used.

getViewUp

Get the view up vector.

getViewUpByReference

Get a reference to the view up vector.

newInstance

Method use to create a new instance of vtkFollower

ArgumentTypeRequiredDescription
initialValuesIFollowerInitialValuesNofor pre-setting some of its content

setCamera

Set the camera to follow. If this is not set, then the follower won't know what to follow.

ArgumentTypeRequiredDescription
cameravtkCameraYes

setUseViewUp

Set whether to use the view up vector.

ArgumentTypeRequiredDescription
useViewUpBooleanYes

setViewUp

Set the viewUp vector.

ArgumentTypeRequiredDescription
viewUpArray[Number]YesThe view up vector.