Game Development Reference
In-Depth Information
switch (tex->axis){
case MAP_X_AXIS:
for (i=0; i<ply->numverts; i++){
pt=&pts[ply->p[i]];
ply->tc[i].u = (pt->z - tex->min.z)/tex->size.z;
ply->tc[i].v = (pt->y - tex->centre.y)/tex->size.y;
}
break;
case MAP_Y_AXIS:
for (i=0; i<ply->numverts; i++){
pt=&pts[ply->p[i]];
ply->tc[i].u = (pt->x - tex->min.x)/tex->size.x;
ply->tc[i].v = (pt->z - tex->centre.z)/tex->size.z;
}
break;
case MAP_Z_AXIS:
for (i=0; i<ply->numverts; i++){
pt=&pts[ply->p[i]];
ply->tc[i].u = (pt->x - tex->min.x)/tex->size.x;
ply->tc[i].v = (pt->y - tex->centre.y)/tex->size.y;
}
break;
}
Figure 6.2 The image map used in the cylindrical and spherical mapping examples.
Search Nedrilad ::




Custom Search