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.
Argument | Type | Required | Description |
---|---|---|---|
publicAPI |
Yes | object on which methods will be bounds (public) | |
model |
Yes | object on which data structure will be bounds (protected) | |
initialValues |
IFollowerInitialValues | No | (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
Argument | Type | Required | Description |
---|---|---|---|
initialValues |
IFollowerInitialValues | No | for 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.
Argument | Type | Required | Description |
---|---|---|---|
camera |
vtkCamera | Yes |
setUseViewUp
Set whether to use the view up vector.
Argument | Type | Required | Description |
---|---|---|---|
useViewUp |
Boolean | Yes |
setViewUp
Set the viewUp vector.
Argument | Type | Required | Description |
---|---|---|---|
viewUp |
Array. |
Yes | The view up vector. |
Source
import vtkActor, { IActorInitialValues } from '../Actor'; |
import { vec3, mat4 } from 'gl-matrix'; |