H3D::TextureTransform3D Class Reference
[X3D node classes.]

The TextureTransform3D node defines a 3D transformation that is applied to texture coordinates (see TextureCoordinate). More...

#include <H3D/TextureTransform3D.h>

Inheritance diagram for H3D::TextureTransform3D:

Inheritance graph

List of all members.

Public Member Functions

 TextureTransform3D (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFVec3f > _center=0, Inst< SFRotation > _rotation=0, Inst< SFVec3f > _scale=0, Inst< SFVec3f > _translation=0)
 Constructor.
virtual void render ()
 Set the GL_TEXTURE matrix to the specified texture transform for the currently active texture unit.

Public Attributes

auto_ptr< SFVec3fcenter
 The offset in texture coordinate space about which the rotation and scale fields are applied.
auto_ptr< SFRotationrotation
 Specifies a rotation in radians of the texture coordinates about the center point after the scale has been applied.
auto_ptr< SFVec3fscale
 Specifies a scaling factor in S and T of the texture coordinates about the center point.
auto_ptr< SFVec3ftranslation
 Specifies a translation of the texture coordinates.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The TextureTransform3D node defines a 3D transformation that is applied to texture coordinates (see TextureCoordinate).

This node affects the way textures coordinates are applied to the geometric surface. The transformation consists of (in order):

These parameters support changes to the size, orientation, and position of textures on shapes. Note that these operations appear reversed when viewed on the surface of geometry. For example, a scale value of (1 2 2) will scale the texture coordinates and have the net effect of shrinking the texture size by a factor of 2 (texture coordinates are twice as large and thus cause the texture to repeat) in the T and R dimensions and leave the S dimension unscaled. A translation of (0.5 0.0 0.0) translates the texture coordinates +.5 units along the S-axis and has the net effect of translating the texture 0.5 along the S-axis on the geometry's surface. A rotation of pi/2 of the texture coordinates results in a pi/2 rotation of the texture on the geometry.

The center field specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied. The scale field specifies a scaling factor in S, T and R of the texture coordinates about the center point. The rotation field specifies a rotation in radians of the texture coordinates about the center point after the scale has been applied. A positive rotation value makes the texture coordinates rotate counterclockwise about the centre, thereby rotating the appearance of the texture itself clockwise. The translation field specifies a translation of the texture coordinates.

In matrix transformation notation, where Tc is the untransformed texture coordinate, Tc' is the transformed texture coordinate, C (center), T (translation), R (rotation), and S (scale) are the intermediate transformation matrices,

Tc' = C * S * R * C * T * Tc

Note that this transformation order is the reverse of the Transform node transformation order since the texture coordinates, not the texture, are being transformed (i.e., the texture coordinate system).

Internal routes:
TextureTransform3D.dot

Member Function Documentation

void TextureTransform3D::render (  )  [virtual]

Set the GL_TEXTURE matrix to the specified texture transform for the currently active texture unit.

Reimplemented from H3D::Node.

References H3DUtil::ArithmeticTypes::Rotationd::angle, H3DUtil::ArithmeticTypes::Rotationd::axis, center, rotation, scale, and translation.


Member Data Documentation

The offset in texture coordinate space about which the rotation and scale fields are applied.

Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )

TextureTransform3D_center.dot

Referenced by render(), and TextureTransform3D().

Specifies a rotation in radians of the texture coordinates about the center point after the scale has been applied.

Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )

TextureTransform3D_rotation.dot

Referenced by render(), and TextureTransform3D().

Specifies a scaling factor in S and T of the texture coordinates about the center point.

Access type: inputOutput
Default value: Vec2f( 1, 1, 1 )

TextureTransform3D_scale.dot

Referenced by render(), and TextureTransform3D().

Specifies a translation of the texture coordinates.

Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )

TextureTransform3D_translation.dot

Referenced by render(), and TextureTransform3D().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:15 2008 for H3D API by  doxygen 1.5.7