vispy.visuals.transforms.linear.
MatrixTransform
Bases: vispy.visuals.transforms.base_transform.BaseTransform
vispy.visuals.transforms.base_transform.BaseTransform
Affine transformation class
4x4 array to use for the transform.
Isometric
Linear
NonScaling
Orthogonal
glsl_imap
glsl_map
imap
Inverse map coordinates
Coordinates to inverse map.
Coordinates.
inv_matrix
map
Map coordinates
Coordinates to map.
matrix
reset
rotate
Rotate the matrix by some angle about a given axis.
The rotation is applied after the transformations already present in the matrix.
The angle of rotation, in degrees.
The x, y and z coordinates of the axis vector to rotate around.
scale
Scale the matrix about a given origin.
The scaling is applied after the transformations already present in the matrix.
Scale factors along x, y and z axes.
The x, y and z coordinates to scale around. If None, (0, 0, 0) will be used.
set_frustum
Set the frustum
Left.
Right.
Bottom.
Top.
Near.
Far.
set_mapping
Set to a 3D transformation matrix that maps points1 onto points2.
Four starting 3D coordinates.
Four ending 3D coordinates.
set_ortho
Set ortho transform
set_perspective
Set the perspective
Field of view.
Aspect ratio.
Near location.
Far location.
shader_imap
see shader_map.
shader_map
Return a shader Function that accepts only a single vec4 argument and defines new attributes / uniforms supplying the Function with any static input.
translate
Translate the matrix
The translation is applied after the transformations already present in the matrix.
Position to translate by.
NullTransform
Transform having no effect on coordinates (identity transform).
STTransform
Transform performing only scale and translate, in that order.
Scale factors for X, Y, Z axes.
as_matrix
from_mapping
Create an STTransform from the given mapping
See set_mapping for details.
Start.
End.
The transform.
Invert map coordinates
move
Change the translation of this transform by the amount given.
The values to be added to the current translation of the transform.
Configure this transform such that it maps points x0 => x1
Start location.
End location.
If False, then the update event is not emitted.
Examples
For example, if we wish to map the corners of a rectangle:
>>> p1 = [[0, 0], [200, 300]]
onto a unit cube:
>>> p2 = [[-1, -1], [1, 1]]
then we can generate the transform as follows:
>>> tr = STTransform() >>> tr.set_mapping(p1, p2) >>> assert tr.map(p1)[:,:2] == p2 # test
zoom
Update the transform such that its scale factor is changed, but the specified center point is left unchanged.
Values to multiply the transform’s current scale factors.
The center point around which the scaling will take place.
Whether center is expressed in mapped coordinates (True) or unmapped coordinates (False).