transform Element Reference
Declares a transformation block which affects all subnodes. More...
Attributes | |
| vector3 | translate |
| Translate origin by the specified vector. | |
| vector9 | rotate |
| Rotation about specified point along specified vector by the given number of degrees. | |
| vector3 | scale |
| Scale transformation. | |
| vector9 | arbitraryTransform |
| Applies an arbitrary homogenous 3D transformation matrix (4x4). | |
Detailed Description
Declares a transformation block which affects all subnodes.Specifies a 3D homogenous transformation which should be applied to all subnodes. This transform can be comprised of any number of individual translate, rotate, scale, and/or arbitraryTransform elements. If multiple translates/scales/rotates/arbitraryTransforms are specified in a single transform block, scales will always be applied first to subnodes, then rotations, then translations, then arbitrary transforms, regardless of the order specified in the scenefile. transform blocks are hierarchical, and transform blocks closer to the definitions of shape nodes will always be applied to those nodes first.
- Note:
- Milton assumes that world-space distances are specified in meters.
Example usage:
Attribute Documentation
| vector3 transform::translate |
Translate origin by the specified vector.
- Note:
- Expects 3 scalar values: "translate" : [ 3, 4, 1 ]
| type | vector3 |
| optional | true |
| vector9 transform::rotate |
Rotation about specified point along specified vector by the given number of degrees.
Expects 9 scalar values: "rotate" : [ px, py, pz, vx, vy, vz, d ] where (px, py, pz) is the origin of the rotation, (vx, vy, vz) is the axis of rotation, and d specifies the amount to rotate in degrees. Ex. "rotate" : [ 0, 0, 0, 1, 0, 0, 90 ] will rotate the world 90 degrees about the x-axis.
| type | vector9 |
| optional | true |
| vector3 transform::scale |
Scale transformation.
Expects 3 scalar values: "scale" : [ dx, dy, dz ] where dx, dy, and dz are the amounts to scale the x, y, and z axes respectively.
| type | vector3 |
| optional | true |
Example usage:
| vector9 transform::arbitraryTransform |
Applies an arbitrary homogenous 3D transformation matrix (4x4).
Expects 16 scalar values; the elements of the transformation matrix in row-major order: "arbitraryTransform" : [ t00, t01, t02, t03, t10, t11, t12, t13, t20, t21, t22, t23, t30, t31, t32, t33 ] where t(i,j) denotes the element of the transformation matrix at row i, column j.
| type | vector9 |
| optional | true |
Example usage:
Generated on 28 Feb 2009 for MiltonScenefileFormat by
1.5.6