User Guide
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.