Description
3D standard shader property; allows you to get or set the texture clamping behavior of any texture
layer. When
TRUE
times across model surfaces. This can be accomplished by setting
shaderReference.textureTransform[textureLayerIndex].scale
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
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
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
shader property; provides access to a transform which modifies the texture
#standard
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 setting. This is the last modification of the texture coordinates before they are sent to the
renderer. The
textureTransform
textureImage space. TextureImage space is defined to exist only on the X,Y plane.
1036
Chapter 14: Properties
, the default, the texture in
property is applied to all texture coordinates regardless of the
property is a matrix that operates on the texture in
textureLayerIndex
can be tiled (repeated) several
to be less than 1 in x or y.
is less than 1 in x or y.
is set to be greater than 1
textureMode
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers