1036
Chapter 14: Properties
Description
3D standard shader property; allows you to get or set the texture clamping behavior of any texture
layer. When
TRUE
, the default, the texture in
textureLayerIndex
can be tiled (repeated) several
times across model surfaces. This can be accomplished by setting
shaderReference.textureTransform[textureLayerIndex].scale
to be less than 1 in x or y.
When this value is set to FALSE, the texture will apply to a smaller portion of model surfaces,
rather than tile across those surfaces, when the
shaderReference.textureTransform[textureLayerIndex].scale
is less than 1 in x or y.
Think of it as shrinking the source image within the frame of the original image and filling in
black around the gap. Similarly, if
shaderReference.textureTransform[textureLayerIndex].scale
is set to be greater than 1
in x or y, the image will be cropped as the border of the texture is extended past the texture
coordinate range.
Example
The following code will textureMap a sphere entirely with a granite texture repeated 4 times
across the surface, and a logo image which covers just 1/4 of the surface.
m = member(2).model("mySphere")
f = member(2).newTexture("granite", #fromCastmember, \
member("granite"))
g = member(2).newTexture("logo", #fromCastmember, member("logo"))
s = member(2).newShader("s", #standard)
s.textureList[1] = g
s.textureList[2] = f
s.textureRepeatList[2] = false
s.textureRepeatList[1] = true
s.textureTransformList[1].scale(0.5,0.5,1.0)
s.textureTransformList[2].scale(0.5,0.5,1.0)
s.textureModeList[2] = #wrapPlanar
s.blendFunctionList[2] = #add
m.shaderList = s
textureTransform
Usage
member(
whichCastmember
).shader(
whichShader
).textureTransform
member(
whichCastmember
).model(
whichModel
).shader.textureTransform
member(
whichCastmember
).model(
whichModel
).shaderList{[index]}.\
textureTransform
Description
3D
#standard
shader property; provides access to a transform which modifies the texture
coordinate mapping of the first texture layer of the shader. Manipulate this transform to tile,
rotate, or translate the texture before applying it to the surface of the model. The texture itself
remains unaffected; the transform merely modifies how the shader applies the texture. The
textureTransform
property is applied to all texture coordinates regardless of the
textureMode
property setting. This is the last modification of the texture coordinates before they are sent to the
renderer. The
textureTransform
property is a matrix that operates on the texture in
textureImage space. TextureImage space is defined to exist only on the X,Y plane.
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...