How
do I texture map a tube?
To texture-map a tube, it is
necessary to compute appropriate values for
s (horizontal texture coordinate) and
t (vertical texture
coordinate). We’ll use a cylindrical
mapping.

Imagine unfolding the tube to a 2D
image.

- For s, it makes sense to have it 0 for the
left side, and increase going to the right.
Values for which s
> 1 will cause the texture to
repeat (if GL_REPEAT is on).
- One can specify t based on the length travelled
along the centreline. Values for which t > 1 will cause the texture to
repeat (if GL_REPEAT is on).