User Guide

663
This statement rotates the first texture used by the shader gbCyl3 by 90° from vector(0, 0, 0):
member("Scene").shader("gbCyl3").textureTransform.rotation = \
vector(0, 0, 90)
textureTransformList
Syntax
shaderReference .textureTransformList[textureLayerIndex]
member(whichCastmember).shader(ShaderName).textureTransformList\
[textureLayerIndex]
member(whichCastmember).shader[shaderListIndex].texture\
TransformList[textureLayerIndex]
member(whichCastmember).model(modelName).shader.texture\
TransformList[textureLayerIndex]
member(whichCastmember).model(modelName).shaderList\
[shaderListIndex]. textureTransformList[textureLayerIndex]
Description
3D standard shader property; this property provides access to a transform which modifies the
texture coordinate mapping of a texture layer. Manipulate this transform to tile, rotate, or
translate a texture image before applying it to the surface of models. The texture itself remains
unaffected, the transform merely modifies how the shader applies the texture.
To tile the image twice along its horizontal axis, use
textureTransformList
[whichTextureLayer].scale(0.5, 1.0, 1.0)
. Scales in Z will be ignored since images are 2D
in nature. Care must be taken to avoid 0.0 scales (even in Z), as that will negate the effect of the
entire texture.
To offset the image by point(xOffset,yOffset), use
textureTransformList
[whichTextureLayer].translate(xOffset,yOffset,0.0)
. Translating by integers when that
texture layers textureRepeat property is
TRUE will have no effect, because the width and height of
the texture will be valued between 0.0 and 1.0 in that case.
To apply a rotation to a texture layer, use
textureTransformList
[whichTextureLayer].rotate(0,0,angle)
. Rotations around the Z axis are rotated around
the (0,0) 2D image point, which maps to the upper left corner of the texture. Rotations about X
and Y will be ignored since images are 2D by nature.
Just as with a models transform,
textureTransform modifications are layerable. To rotate the image
about a point(xOffset,yOffset) instead of point(0,0), first translate to point(0 - xOffset, 0 -
yOffset), then rotate, then translate to point(xOffset, yOffset).
The
textureTransformList is similar to the shader wrapTransformList proper ty with t he following
exceptions.
It is applied in 2D image space rather than 3D world space. As a result, only rotations in Z, and
translations and scales in X and Y, are effective.
The tr ansfor m is appl ied rega rdless of t he
shaderReference.textureModeList[index] setting. The
wrapTransform, by comparison, is only effective when the textureMode is #wrapPlanar,
#wrapCylindrical, or #wrapSpherical.