About solid textures
 
 
 

Solid textures use the surface (x, y, z) point to reference into a three dimensional space of texture values. However, the (x, y, z) point is not passed directly to the table. It is first multiplied by a texture transformation matrix. The default case is no specified texture transformation. In that case, the world space surface point is used directly. If an object moves in world space it will move through its solid texture. A wooden object would move through the wood grain. While this may be desirable in certain animations, it is better to have control over solid texture transformations.

If a transformation is to be used, it must be specified using the following syntax.

In the DEFINITION section, the transformation must be declared using

	transformation example;

Similarly, the transformation name must be included in the DEFINITION of the texture being used. For example,

	color=texture (procedure=Smarble,
	transformation_name=example);

In the MODEL section, use

	example = current_transformation( );

The assignment statement actually saves the current transformation in the hierarchy. This means that if it is placed immediately before the piece of geometry to be textured, the texture will stick to the geometry independent of the transformation applied to the geometry. It is possible to transform the texture in an arbitrary way by bracketing the assignment statement with its own transformations, for example:

	{
		rotate (xaxis,25);
		translate (10,5,2);
		example = current_transformation ( );
	}

NOTE:

1) The definition of the transformation must be BEFORE the definition of the texture.

2) The assignment can be anywhere in the model section, either before or after the patch.

Also note that there is a similar function, current_position, which returns a "triple" - very handy for fancy camera/spotlight motions.