Applying Textures to Geometries
43
Figure 3-3 Texture Coordinates
Texture coordinates are assigned to each vertex of a geometry either by you or by Cosmo
3D.
Applying a Texture
To apply a texture to a geometry, set the argument of the csAppearance::setTexEnable()
method to ON. If you do not want to apply a texture to a geometry, set the argument of
setTexEnable() to OFF.
Texture rendering uses the texture values specified in csContext by default. To set the
texture values locally, however, use the following methods in csAppearance:
setTexture() to specify the image used as the texture.
setTexMode() to specify the speed and quality of the rendered texture.
setTexBlendColor()
to specify the color to use in “blend” mode.
setTexEnv() to specify how texture colors are blended with the colors of a geometry.
setTexGen(), setTexGenEnable()
to generate, if enabled, texture coordinates automatically instead of
using the csGeoSet’s TexCoordSet.
The following sections describe these methods.
1.0
0.0 1.0
t
s