| VrmlMatrix |  |  |
VrmlMatrix Object
| |

 |
ApplyTransform method ( NodeOrField As Object ).
Decomposes the VrmlMatrix object and applies it to a Transform or Viewpoint node or a SFVec3f or MFVec3f field.
NodeOrField A Node object that represents a Transform or Viewpoint node. The method decomposes the matrix and stores the components in translation, rotation, scale, scaleOrientation and center fields of a Transform node or position and orientation fields of a Viewpoint node. For all other node types the method succeeded but does nothing.
The following lines of code are identical in the case of a Transform node:
Dim n As Node
Dim mx As VrmlMatrix
n.Matrix = mx
|
Dim n As Node
Dim mx As VrmlMatrix
mx.ApplyMatrix n
|
Dim n As Node
Dim mx As VrmlMatrix
mx.GetTransform n("translation"), n("rotation"),_
n("scale"), n("scaleOrientation"), n("center")
|
A SFVec3f or a MFValue object or a Field object that represents SFVec3f or MFVec3f VRML field. The vector or vectors of the field object is multiplied by the matrix, with the product replacing the field value.
The following example rotates the first indexed faceset in a scene on 90° around Z-axis.
Set mx = Document.NewMatrix
mx.Rotate 0, 0, 1, 90
Set fs = Document.StdProtos("IndexedFaceSet").Instances(1)
mx.ApplyTransform fs("coord")("point")
|
|

| |

 |
Divide method ( Arg As Object ) As Object.
Divides the current matrix by the passed Arg matrix and returns the result as a new VrmlMatrix object.
Arg A VrmlMatrix object that represents 4x4 matrix of single-precision floating-point values.
|

| |

 |
GetTransform method ( [translation], [rotation], [scale], [scaleOrientation], [center] ).
Decomposes the matrix and returns the components in the passed translation, rotation, scale, scaleOrientation and center Field, SFVec3f or SFRotation objects. If any passed object is not sent, or if the empty object is sent for any value, that value is not returned.
The following VBScript example creates a new Viewpoint node and initializes it by a given matrix.
Set mx = NewMatrix
mx.Rotate 0, 1, 0, 30
mx.Translate 5, 1, 0
Set n = RootNodes.Add("Viewpoint")
mx.GetTransform n("position"), n("orientation")
|
See also: Matrix property of the Node object.
|

| |

 |
Inverse method ( ) As Object.
Returns a VrmlMatrix object whose value is the inverse of this object.
|

| |

 |
Multiply method ( Arg As Object ) As Object.
Multiplies the current matrix by the passed Arg matrix and returns the result as a new VrmlMatrix object.
Arg A VrmlMatrix object that represents 4x4 matrix of single-precision floating-point values.
The following VBScript function returns global transformation matrix of a node or field at the caret position.
Private Function CurrentMatrix
Set mx = NewMatrix
Set ent = CurrentEntity
Do Until ent Is Nothing
If ent.EntityType = vpNode Then
Set mx = ent.Matrix.Multiply(mx)
End If
Set ent = ent.Owner
Loop
Set CurrentMatrix = mx
End Function
|
|

| |

 |
Rotate method ( x As Single, y As Single, z As Single, angle As Single ).
Computes a matrix that performs a counterclockwise rotation of angle degrees about the vector from the origin through the point (x, y, z). The specified matrix is multiplied by the rotation matrix, with the product replacing the specified matrix. That is, if M is the specified matrix and R is the rotation matrix, then M is replaced with M×R.
|

| |

 |
Scale method ( x As Single, y As Single, z As Single ).
Produces a general scaling along the x, y and z axes. The three arguments indicate the desired scale factors along each of the three axes. The specified matrix is multiplied by the scale matrix, with the product replacing the specified matrix. That is, if M is the specified matrix and S is the scale matrix, then M is replaced with M×S.
The following VBScript example scales the first Transform node in a scene by the factor of 2.
Set tr = StdProtos("Transform").Instances(1)
Set mx = tr.Matrix
mx.Scale 2, 2, 2
tr.Matrix = mx
|
|

| |

 |
SetTransform method ( [translation], [rotation], [scale], [scaleOrientation], [center] ).
Sets the specified VrmlMatrix object to the passed Field, SFVec3f or SFRotation objects. Any of the parameters may be omitted. The method has 0 to 5 parameters. For example, specifying 0 parameters results in an identity matrix while specifying 1 parameter results in a translation and specifying 2 parameters results in a translation and a rotation. Any unspecified parameter is set to its default as specified for the Transform node.
See also: Matrix property of the Node object.
|

| |

 |
Translate method ( x As Single, y As Single, z As Single ).
Moves the coordinate system origin to the point specified by (x, y, z). The specified matrix is multiplied by the translation matrix, with the product replacing the specified matrix. That is, if M is the specified matrix and T is the translation matrix, then M is replaced with M×T.
|

| |

 |
Value property, default, read/write, Variant.
Gets or sets an array of 3x4 matrix of single-precision floating-point values stored in column-major order.
|

|
|
|