SFMatrix3f
The SFMatrix3f object provides many useful functions for performing manipulations on 3x3 matrices.
Each of element of the matrix can be accessed using C-style array dereferencing (i.e., m[0][1]
is the element in row 0, column 1). The results of dereferencing a SFMatrix3f object using a single index (i.e., m[0]
) are undefined. The translation elements are in the third row. For example, m[2][0]
is the X offset.Additionally the individual rows of the matrix may be addressed using array-style indexing returning a SFMatrix3Row instance. The values of the SFMatrix3Row instance can be accessed using C-Style array dereferencing (e.g., m[0] is f11, [2] is f12, and [3] is f13.
Properties
Type | Property | Description | Standard |
---|
Functions
Return type | Function | Description | Standard |
---|---|---|---|
void | setTransform(SFVec2f translation, SFVec3f rotation, SFVec2f scale, SFVec3f scaleOrientation, SFVec2f center) | Sets the Matrix to the passed values. Any of the rightmost parameters may be omitted. The function has zero to five parameters. For example, specifying zero parameters results in an identity matrix while specifying one parameter results in a translation and specifying two parameters results in a translation and a rotation. Any unspecified parameter is set to its default as specified for the Transform node. Values are applied to the matrix in the same order as the matrix field calculations for the Transform node. | Avalon |
void | getTransform(SFVec2f translation, SFVec3f rotation, SFVec2f scale) | Decomposes the Matrix and returns the components in the passed translation, rotation, and scale objects. The types of these passed objects is the same as the first three arguments to setTransform. If any passed object is not sent, or if the null object is sent for any value, that value is not returned. Any projection or shear information in the matrix is ignored. | Avalon |
SFMatrix3f | inverse() | Returns a new SFMatrix3f whose value is the inverse of this object.
| Avalon |
SFMatrix3f | transpose() | Returns a new SFMatrix3f whose value is the transpose of this object.
| Avalon |
SFMatrix3f | multLeft(SFMatrix3f n) | Returns a new SFMatrix3f whose value is the object multiplied by the passed matrix on the left.
| Avalon |
SFMatrix3f | multRight(SFMatrix3f m) | Returns a new SFMatrix3f whose value is the object multiplied by the passed matrix on the right.
| Avalon |
SFVec2f | multVecMatrix(SFVec2f vec) | Returns a new SFVec2f whose value is the object multiplied by the passed row vector.
| Avalon |
SFVec2f | multMatrixVec(SFVec2f vec) | Returns a new SFVec2f whose value is the object multiplied by the passed column vector..
| Avalon |
String | toString() | Returns a String containing the matrix contents encoded using the X3D Classic VRML encoding.
| Avalon |