GINO Graphics Suite - GINO v9.0  

gSetTextureCoordGeneration

Syntax

[C/C++:]
void gSetTextureCoordGeneration(int mode, ...);
[F90:]
subroutine gSetTextureCoordGeneration(mode, gSVec, gTVec)
integer, intent(in) :: mode
type (GTEXVEC), optional, intent(in) :: gSVec,gTVec

Arguments

mode
Texture coordinate generation mode

= GOFF, Switch off texture coordinate generation (default)
= GOBJECT, Use object coordinates
= GSPHERICAL, Generate spherical texture coordinates

Optional Args.

gSVec, gTVec
Object coordinate transformation vectors for S and T texture coordinates

gSVec.trans, gTVec.trans
Object coordinate type

= GSPACE, Use untransformed object coordinates
= GPICTURE, Use transformed object coordinates

gSVec.xfactor, gTVec.xfactor
Scale factor for object's X coordinate

gSVec.yfactor, gTVec.yfactor
Scale factor for object's Y coordinate

gSVec.zfactor, gTVec.zfactor
Scale factor for object's Z coordinate

gSVec.wfactor, gTVec.wfactor
Scale factor for object's W coordinate

Description

The routine gSetTextureCoordGeneration() sets the current GINO texture coordinate generation mode which by default is off.

When the mode is set to GOBJECT the optional arguments gSVec and/or gTVec are used to specify the transformation of the object's coordinates required to generate the S and T texture coordinates respectively. The structure, of type GTEXVEC, contains the object coordinate type to be used and the scale factors to be applied to each of its coordinates.

Thus the texture coordinate at each vertex is calculated as:

S = svec.xfactor * x + svec.yfactor * y + svec.zfactor * z + svec.wfactor * w

and

T = tvec.xfactor * x + tvec.yfactor * y + tvec.zfactor * z + tvec.wfactor * w

where x,y,z,w are the objects' untransformed or transformed coordinates at this vertex.

Note that C/C++ users should pass the address of the structure along with the gSVec and/or gTVec arguments as shown in the example code in the section referenced below.

The GSPHERICAL mode generates texture coordinates based on a sphere centred around the view centre. It should only be used, however, when a correctly prepared environment texture map is available, representing the image of a scene taken through a very wide-angle lens.

See Also

gSetTextureCoordGeneration Usage
gDefineTexture
gDrawFacet