TextureTransform

Definition :

TextureTransform {
  exposedField SFVec2f center      0 0
  exposedField SFFloat rotation    0
  exposedField SFVec2f scale       1 1
  exposedField SFVec2f translation 0 0
}


Explanation :

The TextureTransform node defines a 2D transformation that is applied to texture coordinates. This node affects the way textures are applied to the surface of geometry. The transformation consists of (in order) a non-uniform scale about an arbitrary center point, a rotation about the center point, and a translation. This allows for changes to the size, orientation, and position of textures on shapes. Note that these changes appear reversed when when viewed in the surface of geometry. For example, a scale value of 2 2 will scale the texture coordinates and have the net effect of shrinking the texture size by a factor of 2 (texture coordinates are twice as large and thus cause the texture to repeat). A translation of 0.5 0.0 translates the texture coordinates +.5 units along the S-axis and has the net effect of translating the texture -0.5 along the S-axis on the geometry's surface. A rotation of PI/2 of the texture coordinates results in a -PI/2 rotation of the texture on the geometry.

The center field specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied. The scale field specifies a scaling factor in S and T of the texture coordinates about the center point - scale values must be >= 0.0. The rotation field specifies a rotation in radians of the texture coordinates about the center point after the scale has taken place. The translation field specifies a translation of the texture coordinates.

Given a 2-dimensional texture coordinate T and a TextureTransform node, T is transformed into point T' by a series of intermediate transformations. In matrix-transformation notation, where C (center), T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,

T' = TT x C x R x S x -TC x T (where T is a column vector)

Note that TextureTransforms cannot combine or accumulate.

Examples