CHAPTER 5 ■ GETTING THE MOST OUT OF VERTICES
410
TextureAddressMode.Wrap
Although this is the default texture addressing mode, after using a different one you can rese-
lect wrapping using this code:
device.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
device.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
Using this addressing mode, the graphics card will keep adding or subtracting 1 from the
coordinate until it enters the [0,1] range.
Graphically,thiswillresultintheoriginaltexturebeingcopied,asshownintherightpart
of Figure 5-5.
Here are some example texture coordinate mappings:
(–0.5f,1.5f)
➤ (0.5f,0.5f)
(1.2f,–0.2f)
➤ (0.2f,0.8f)
(–0.7f,–1.2f)
➤ (0.3f,0.8f)
TextureAddressMode.Mirror
Use this code to set the texture addressing ...