User Guide

346 APPENDIX E
MTSTexture
An MTSTexture object is used to represent a Viewpoint texture, which may be used by a Viewpoint material to control
the appearance of a surface. This object also inherits all the methods of the MTSBaseObject.
Properties
scaleX
Specifi es the texture scale in the horizontal direction.
textureObj.scaleX = 3;
scaleX
Specifi es the texture scale in the vertical direction.
textureObj.scaleY = 5;
translateX
Change the origin of the texture in the horizontal direction where 1.0 is the width of the texture cell.
textureObj.translateX = 0.5; //offset the texture by horizontally by 50%
translateY
Change the origin of the texture in the vertical direction where 1.0 is the height of the texture cell.
// offset the texture vertically by 20%
textureObj.translateY = 0.2;
llColor
Specify the fi ll color for the texture as an array of three values [ R, G, B ]. Note that setting this property will
cover the texture with the color specifi ed. The texture can be exposed again by resetting the texture path using
the MTSImageStream property “path.
// set to red
textureOjb.fi llColor = [ 1, 0, 0 ];
size
Returns the size of the image as stored in the Viewpoint buffer. (Does not necessarily represent the original
image size. See the methods below to obtain exact pixel dimensions of the image used for the texture.)
[localPropertyCodeSample]
mip
Returns whether the texture object is using MipMapping (specifi ed in the MTX fi le).
isMipped = textureObj.mip;
mipBias
Sets the Mip bias for the texture object (if Mipmapping is enabled in the MTX fi le). Mipmapping causes the
texture to appear blurred at a distance, and helps to eliminate pixelation anomalies during rendering. Typical
appropriate values range from 0.25 to 8.0.