Glyph Version 7.22.2 |
## pwu:: TransformUtility functions for transform matrices, which are represented as a list of sixteen real values. Summary
## set
Set an element of a transform matrix ## Parameters
## Returnsa transform matrix that is the same as the given transform matrix, except the element that has been set to the given value ## applyToDirection
Transform a direction vector by the given transform matrix. This differs from apply as follows. When transforming a point by a 4x4 matrix, the point is represented by a vector with X, Y, and Z as the first 3 components and 1 as the fourth component. This allows the point to pick up any translation component in the matrix. This method represents the direction as a vector with 0 as the fourth component. Since a direction can be thought of as the difference between two points, a zero fourth component is the difference between two points that have 1 as the fourth component. ## Parameters
## Returnsthe transformed direction vector ## applyToNormal
Transform a normal vector by the given transform matrix. A normal vector is transformed by multiplying the normal by the transposed inverse matrix. ## Parameters
## Returnsthe transformed normal vector (normalized) ## applyToPlane
Transform a plane by the given transform matrix. ## Parameters
## Returnsthe transformed plane ## rotate
Multiply the given transform matrix by a rotation transform ## Parameters
## Returnsthe matrix multiplied by the rotation transform ## rotation
Return a transform matrix that is a rotation of the given quaternion, axis angle pair, or pair of vectors representing the new X and Y directions. ## Parameters
## ReturnsThis action returns a rotation matrix. ## scale
Multiply the given transform matrix by a scaling transform ## Parameters
## Returnsthe matrix multiplied by the scaling matrix ## calculatedScaling
Return a transform matrix that scales a given point from one location to another anchored at a third point ## Parameters
## Returnsthe scaling matrix ## ortho
Create an orthonormal view transform matrix from a view frustum ## Parameters
## Returnsthe view transform matrix ## perspective
Create a perspective view transform matrix from a view frustum ## Parameters
## Returnsthe view transform matrix ## stretch
Multiply the given transform matrix by a stretching transform. If the vector defined by the start and end points is orthogonal to the vector defined by the start and anchor points, the transform is undefined and the matrix will be set to the identity matrix. ## Parameters
## Returnsthe matrix multiplied by the stretching matrix ## stretching
Return a transform matrix that is a stretching transform. If the vector defined by the start and end points is orthogonal to the vector defined by the start and anchor points, the transform is undefined and the matrix will be set to the identity matrix. ## Parameters
## Returnsthe stretching matrix |

Return an identity transform matrix

pwu::Transform identity

Set an element of a transform matrix

pwu::Transform set matrix i j value

Get an element of a transform matrix

pwu::Transform element matrix i j

Transform a vector point matrix by the given transform matrix

pwu::Transform apply matrix vec

Transform a direction vector by the given transform matrix.

pwu::Transform applyToDirection matrix dir

Transform a normal vector by the given transform matrix.

pwu::Transform applyToNormal matrix normal

Transform a plane by the given transform matrix.

pwu::Transform applyToPlane matrix plane

Multiply one transform matrix by another

pwu::Transform multiply matrix1 matrix2

Return the determinant of a given transform matrix

pwu::Transform determinant matrix

Return the transpose of a given transform matrix

pwu::Transform transpose matrix

Return the inverse of a given transform matrix

pwu::Transform inverse matrix

Multiply the given transform matrix by a translation transform

pwu::Transform translate matrix offset

Return a transform matrix that is a translation of the given offset

pwu::Transform translation offset

Multiply the given transform matrix by a rotation transform

pwu::Transform rotate ?-anchor anchor_pt? matrix axis angle

Return a transform matrix that is a rotation of the given quaternion, axis angle pair, or pair of vectors representing the new X and Y directions.

pwu::Transform rotation ?-anchor anchor_pt? < quat | axis angle | right up >

Multiply the given transform matrix by a scaling transform

pwu::Transform scale ?-anchor anchor_pt? matrix scale

Return a transform matrix that is a scaling of the given vector

pwu::Transform scaling ?-anchor anchor_pt? scale_vec

Return a transform matrix that scales a given point from one location to another anchored at a third point

pwu::Transform calculatedScaling anchor start end ?tol?

Create an orthonormal view transform matrix from a view frustum

pwu::Transform ortho left right bottom top near far

Create a perspective view transform matrix from a view frustum

pwu::Transform perspective left right bottom top near far

Multiply the given transform matrix by a mirroring transform

pwu::Transform mirror matrix normal dist

Return a transform matrix that is a mirroring of the given plane

pwu::Transform mirroring normal dist

Return a transform matrix that is a mirroring of the given plane

pwu::Transform mirrorPlane plane

Multiply the given transform matrix by a stretching transform.

pwu::Transform stretch matrix anchor start end

Return a transform matrix that is a stretching transform.

pwu::Transform stretching anchor start end

Utility functions for planes, which are represented as a list of four real values (the A, B, C and D coeffecients).