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

TextureCoordinateGenerator supports the automatic generation of texture coodinates for geometric shapes. More...

#include <H3D/TextureCoordinateGenerator.h>

Inheritance diagram for H3D::TextureCoordinateGenerator:

Inheritance graph

List of all members.

Public Member Functions

 TextureCoordinateGenerator (Inst< SFNode > _metadata=0, Inst< SFString > _mode=0, Inst< MFFloat > _parameter=0)
 Constructor.
virtual bool supportsTexGen ()
 Returns true.
virtual void startTexGen ()
 Start hardware texture coordinate generation.
virtual void stopTexGen ()
 Stop the texture coordinate generation started with startTexGen().

Public Attributes

auto_ptr< SFStringmode
 The mode field describes the algorithm used to compute texture coordinates.
auto_ptr< MFFloatparameter
 Parameters that can be used as input to the texture coordinate algorithm.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

TextureCoordinateGenerator supports the automatic generation of texture coodinates for geometric shapes.

This node only implements some of the modes that are specified in the X3D specification.

This node can be used to set the texture coordinates for a node with a texCoord field.

The mode field describes the algorithm used to compute texture coordinates.

The available modes in H3D API are:
H3D API specific modes (not part of the X3D standard)
"GL_SPHERE"Sphere mapping using the GL_SPHERE_MAP function in OpenGL. See documentation for glTexGen for details
"MATRIX"Specify directly the matrix for transforming from vertex coordinates to texture coordinates. The matrix values are given in the parameter field and 12 values are required. The resulting texture coordinates will be:
s = p[0] * v.x + p[1] * v.y + p[2] * v.z + p[3]
t = p[4] * v.x + p[5] * v.y + p[6] * v.z + p[7]
r = p[8] * v.x + p[9] * v.y + p[10] * v.z + p[11]

where p[i] is the i:th value of the parameter field and v is a vertex.
X3D modes
"CAMERASPACEPOSITION"Use the vertex position, transformed to camera space, as input texture coordinates
"COORD"use vertex coordinates
"COORD-EYE"use vertex coordinates transformed to
"CAMERASPACEREFLECTIONVECTOR"Use the reflection vector, transformed to camera space, as input texture coordinates.>/tr>
"CAMERASPACENORMAL"Use the vertex normal, transformed to camera space, as input texture coordinates, resulting coordinates are in -1 to 1 range.

The parameter field gives input paramters that can be used by the algorithm specified by the mode field.

Internal routes:
TextureCoordinateGenerator.dot

Member Function Documentation

void TextureCoordinateGenerator::startTexGen (  )  [virtual]


Member Data Documentation

The mode field describes the algorithm used to compute texture coordinates.

Access type: inputOutput
Default value: "GL_SPHERE"

TextureCoordinateGenerator_mode.dot

Referenced by startTexGen(), and TextureCoordinateGenerator().

Parameters that can be used as input to the texture coordinate algorithm.

Access type: inputOutput

TextureCoordinateGenerator_parameter.dot

Referenced by startTexGen(), and TextureCoordinateGenerator().


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

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