Section: Visualization Toolkit Common Classes
To create an instance of class vtkPerspectiveTransform, simply invoke its constructor as follows
obj = vtkPerspectiveTransform
obj
is an instance of the vtkPerspectiveTransform class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkPerspectiveTransform = obj.NewInstance ()
vtkPerspectiveTransform = obj.SafeDownCast (vtkObject o)
obj.Identity ()
- Set this transformation to the identity transformation. If
the transform has an Input, then the transformation will be
reset so that it is the same as the Input.
obj.Inverse ()
- Invert the transformation. This will also set a flag so that
the transformation will use the inverse of its Input, if an Input
has been set.
obj.AdjustViewport (double oldXMin, double oldXMax, double oldYMin, double oldYMax, double newXMin, double newXMax, double newYMin, double newYMax)
- Perform an adjustment to the viewport coordinates. By default Ortho,
Frustum, and Perspective provide a window of ([-1,+1],[-1,+1]).
In PreMultiply mode, you call this method before calling Ortho, Frustum,
or Perspective. In PostMultiply mode you can call it after. Note
that if you must apply both AdjustZBuffer and AdjustViewport, it
makes no difference which order you apply them in.
obj.AdjustZBuffer (double oldNearZ, double oldFarZ, double newNearZ, double newFarZ)
- Perform an adjustment to the Z-Buffer range that the near and far
clipping planes map to. By default Ortho, Frustum, and Perspective
map the near clipping plane to -1 and the far clipping plane to +1.
In PreMultiply mode, you call this method before calling Ortho, Frustum,
or Perspective. In PostMultiply mode you can call it after.
obj.Ortho (double xmin, double xmax, double ymin, double ymax, double znear, double zfar)
- Create an orthogonal projection matrix and concatenate it by the
current transformation. The matrix maps [xmin,xmax], [ymin,ymax],
[-znear,-zfar] to [-1,+1], [-1,+1], [+1,-1].
obj.Frustum (double xmin, double xmax, double ymin, double ymax, double znear, double zfar)
- Create an perspective projection matrix and concatenate it by the
current transformation. The matrix maps a frustum with a back
plane at -zfar and a front plane at -znear with extent
[xmin,xmax],[ymin,ymax] to [-1,+1], [-1,+1], [+1,-1].
obj.Perspective (double angle, double aspect, double znear, double zfar)
- Create a perspective projection matrix by specifying the view angle
(this angle is in the y direction), the aspect ratio, and the near
and far clipping range. The projection matrix is concatenated
with the current transformation. This method works via Frustum.
obj.Shear (double dxdz, double dydz, double zplane)
- Create a shear transformation about a plane at distance z from
the camera. The values dxdz (i.e. dx/dz) and dydz specify the
amount of shear in the x and y directions. The 'zplane' specifies
the distance from the camera to the plane at which the shear
causes zero displacement. Generally you want this plane to be the
focal plane.
This transformation can be used in combination with Ortho to create
an oblique projection. It can also be used in combination with
Perspective to provide correct stereo views when the eye is at
arbitrary but known positions relative to the center of a flat
viewing screen.
obj.Stereo (double angle, double focaldistance)
- Create a stereo shear matrix and concatenate it with the
current transformation. This can be applied in conjunction with either a
perspective transformation (via Frustum or Projection) or an
orthographic projection. You must specify the distance from
the camera plane to the focal plane, and the angle between
the distance vector and the eye. The angle should be negative
for the left eye, and positive for the right. This method
works via Oblique.
obj.SetupCamera (double position[3], double focalpoint[3], double viewup[3])
- Set a view transformation matrix for the camera (this matrix does
not contain any perspective) and concatenate it with the current
transformation.
obj.SetupCamera (double p0, double p1, double p2, double fp0, double fp1, double fp2, double vup0, double vup1, double vup2)
obj.Translate (double x, double y, double z)
- Create a translation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
obj.Translate (double x[3])
- Create a translation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
obj.Translate (float x[3])
- Create a translation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
obj.RotateWXYZ (double angle, double x, double y, double z)
- Create a rotation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
The angle is in degrees, and (x,y,z) specifies the axis that the
rotation will be performed around.
obj.RotateWXYZ (double angle, double axis[3])
- Create a rotation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
The angle is in degrees, and (x,y,z) specifies the axis that the
rotation will be performed around.
obj.RotateWXYZ (double angle, float axis[3])
- Create a rotation matrix and concatenate it with the current
transformation according to PreMultiply or PostMultiply semantics.
The angle is in degrees, and (x,y,z) specifies the axis that the
rotation will be performed around.
obj.RotateX (double angle)
- Create a rotation matrix about the X, Y, or Z axis and concatenate
it with the current transformation according to PreMultiply or
PostMultiply semantics. The angle is expressed in degrees.
obj.RotateY (double angle)
- Create a rotation matrix about the X, Y, or Z axis and concatenate
it with the current transformation according to PreMultiply or
PostMultiply semantics. The angle is expressed in degrees.
obj.RotateZ (double angle)
- Create a rotation matrix about the X, Y, or Z axis and concatenate
it with the current transformation according to PreMultiply or
PostMultiply semantics. The angle is expressed in degrees.
obj.Scale (double x, double y, double z)
- Create a scale matrix (i.e. set the diagonal elements to x, y, z)
and concatenate it with the current transformation according to
PreMultiply or PostMultiply semantics.
obj.Scale (double s[3])
- Create a scale matrix (i.e. set the diagonal elements to x, y, z)
and concatenate it with the current transformation according to
PreMultiply or PostMultiply semantics.
obj.Scale (float s[3])
- Create a scale matrix (i.e. set the diagonal elements to x, y, z)
and concatenate it with the current transformation according to
PreMultiply or PostMultiply semantics.
obj.SetMatrix (vtkMatrix4x4 matrix)
- Set the current matrix directly. This actually calls Identity(),
followed by Concatenate(matrix).
obj.SetMatrix (double elements[16])
- Set the current matrix directly. This actually calls Identity(),
followed by Concatenate(matrix).
obj.Concatenate (vtkMatrix4x4 matrix)
- Concatenates the matrix with the current transformation according
to PreMultiply or PostMultiply semantics.
obj.Concatenate (double elements[16])
- Concatenates the matrix with the current transformation according
to PreMultiply or PostMultiply semantics.
obj.Concatenate (vtkHomogeneousTransform transform)
- Concatenate the specified transform with the current transformation
according to PreMultiply or PostMultiply semantics.
The concatenation is pipelined, meaning that if any of the
transformations are changed, even after Concatenate() is called,
those changes will be reflected when you call TransformPoint().
obj.PreMultiply ()
- Sets the internal state of the transform to PreMultiply. All subsequent
operations will occur before those already represented in the
current transformation. In homogeneous matrix notation, M = M*A where
M is the current transformation matrix and A is the applied matrix.
The default is PreMultiply.
obj.PostMultiply ()
- Sets the internal state of the transform to PostMultiply. All subsequent
operations will occur after those already represented in the
current transformation. In homogeneous matrix notation, M = A*M where
M is the current transformation matrix and A is the applied matrix.
The default is PreMultiply.
int = obj.GetNumberOfConcatenatedTransforms ()
- Get the total number of transformations that are linked into this
one via Concatenate() operations or via SetInput().
vtkHomogeneousTransform = obj.GetConcatenatedTransform (int i)
- Set the input for this transformation. This will be used as the
base transformation if it is set. This method allows you to build
a transform pipeline: if the input is modified, then this transformation
will automatically update accordingly. Note that the InverseFlag,
controlled via Inverse(), determines whether this transformation
will use the Input or the inverse of the Input.
obj.SetInput (vtkHomogeneousTransform input)
- Set the input for this transformation. This will be used as the
base transformation if it is set. This method allows you to build
a transform pipeline: if the input is modified, then this transformation
will automatically update accordingly. Note that the InverseFlag,
controlled via Inverse(), determines whether this transformation
will use the Input or the inverse of the Input.
vtkHomogeneousTransform = obj.GetInput ()
- Set the input for this transformation. This will be used as the
base transformation if it is set. This method allows you to build
a transform pipeline: if the input is modified, then this transformation
will automatically update accordingly. Note that the InverseFlag,
controlled via Inverse(), determines whether this transformation
will use the Input or the inverse of the Input.
int = obj.GetInverseFlag ()
- Get the inverse flag of the transformation. This controls
whether it is the Input or the inverse of the Input that
is used as the base transformation. The InverseFlag is
flipped every time Inverse() is called. The InverseFlag
is off when a transform is first created.
obj.Push ()
- Pushes the current transformation onto the transformation stack.
obj.Pop ()
- Deletes the transformation on the top of the stack and sets the top
to the next transformation on the stack.
vtkAbstractTransform = obj.MakeTransform ()
- Make a new transform of the same type -- you are responsible for
deleting the transform when you are done with it.
int = obj.CircuitCheck (vtkAbstractTransform transform)
- Check for self-reference. Will return true if concatenating
with the specified transform, setting it to be our inverse,
or setting it to be our input will create a circular reference.
CircuitCheck is automatically called by SetInput(), SetInverse(),
and Concatenate(vtkXTransform *). Avoid using this function,
it is experimental.
long = obj.GetMTime ()
- Override GetMTime to account for input and concatenation.