textureTransformList 1037
To tile the image twice along its horizontal axis, use
shaderReference.textureTransform.scale(0.5, 1.0, 1.0)
. Scaling on the Z axis
is ignored.
To offset the image by
point(xOffset,yOffset)
, use
shaderReference.textureTransform.translate(xOffset,yOffset,0.0)
. Translating by
integers when the shader’s
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
shaderReference.textureTransform.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 the X and Y axes are ignored.
Just as with a model's transform,
textureTransform
modifications are layerable. To rotate the
texture 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
textureTransform
is
similar to the shader’s
wrapTransform
property with the following exceptions. It is applied in 2d
image space rather than 3d world space. As a result, only rotations about the Z axis and
translations and scales on X and Y axes are effective. The transform is applied regardless of the
shaderReference.textureMode
setting. The
wrapTransform
, by comparison, is only effective
when the
textureMode
is
#wrapPlanar
,
#wrapCylindrical
, or
#wrapSpherical
.
Example
This statement shows the
textureTransform
of the first texture in the first shader used by the
model gbCyl3:
put member("Scene").model("gbCyl3").shader.textureTransform
-- transform(1.0000, 0.0000, 0.0000,0.0000, 0.0000, 1.0000, \
0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000, 0.0000, \
0.0000, 1.0000)
The following statement halves the height and width of the first texture used by the shader named
gbCyl3. If the
textureRepeat
property of gbCyl3 is set to
TRUE
, four copies of the texture will be
tiled across the shader.
member("Scene").shader("gbCyl3").textureTransform.scale = \
vector(0.5, 0.5, 1)
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
Usage
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
]
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...