transform Element Reference

Declares a transformation block which affects all subnodes. More...

List of all members.

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:

"transform" : {
// scale a unit cube uniformly by 1/2, then rotate about the x-axis by 90 degrees,
// then translate up three units about the new x axis
// note: if multiple transformations are listed in a single transform block,
// all rotations will be applied first, then all scales, then all translations
"translate" : [ 3, 0, 0 ],
"rotate" : [ 0, 0, 0, 1, 0, 0, 90 ],
"scale" : [ .5, .5, .5 ],

// cube in unit box from [ -.5, -.5, -.5 ] to [ .5, .5, .5 ]
"cube" : { }

// ... (elided) other nodes which this transform should be applied to
},

Attribute Documentation

Translate origin by the specified vector.

Note:
Expects 3 scalar values: "translate" : [ 3, 4, 1 ]
typevector3
optionaltrue

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.

typevector9
optionaltrue

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.

typevector3
optionaltrue

Example usage:

"transform" : {
"scale" : [ 5, 5, 5 ] // scale the world uniformly by a factor of 5

// ... (elided) nodes which this transform should be applied to
},

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.

typevector9
optionaltrue

Example usage:

"transform" : {
// translation by [ 3, 3, 3 ] specified by an arbitrary 4x4 matrix
"arbitraryTransform" : [ 1, 0, 0, 3, 0, 1, 0, 3, 0, 0, 1, 3, 0, 0, 0, 1 ]

// ... (elided) nodes which this transform should be applied to
},


Generated on 28 Feb 2009 for MiltonScenefileFormat by doxygen 1.5.6