#### Archived

This topic is now archived and is closed to further replies.

# Texture Wrap s, t, and r????

This topic is 6103 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

The redbook specifys GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, and GL_TEXTURE_WRAP_R. Whats the situation where these different ones can be applied? When he''s best, he''s little worst than a man, When he''s worst, he''s little better than a beast.

##### Share on other sites
Not sure, but I think S = X-axis, T = y-axis, and R might be Z-axis (for 3D textures). Don''t they give a description of what each of them does?

By all means correct me if I''m wrong,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//

[if you have a link proposal, email me.]

##### Share on other sites
I couldnt find any descriptions for any of them?

Edited by - Eber Kain on February 3, 2002 8:42:04 PM

##### Share on other sites
S, R, T and Q coordinates

S, R, T and Q coordinates are for texture coordinates what X, Y, Z and W are for vertex coordinates.

From OpenGL specifications :
quote:

The commands
void TexCoord{1234}{sifd}( T coords );
void TexCoord{1234}{sifd}v( T coords );
specify the current homogeneous texture coordinates, named s, t, r, and q. The TexCoord1 family of commands set the s coordinate to the provided single argument while setting t and r to 0 and q to 1. Similarily, TexCoord2 sets s and t to the specified values, r to 0 and q to 1; TexCoord3 sets s, t, and r, with q set to 1, and TexCoord4 sets all four texture coordinates.

Texture wrapping

GL_TEXTURE_WRAP_i, with i being S, T, or R, set the wrapping mode for each texture coordinate.
GL_CLAMP forces texture coordinates to lie within the [0,1] range (eg, coordinates lower than 0.0f pick a texture coordinate 0, and coordinates greater than 1 pick a texture coordinate 1.0f) whereas GL_REPEAT repeats the texture out of the [0,1] range (for instance, a texture coordinate 1.25 will pick the texture coordinate 0.25).
Note thar both implementations are identical if all texture coordinates lie between 0 and 1.

From OpenGL specifications :
quote:

If TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R is set to REPEAT, then the GL ignores the integer part of s, t, or r coordinates, respectively, using only the fractional part. (...) CLAMP causes s, t, or r coordinates to be clamped to the range [0,1].

Hope this helps.

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 11
• 13
• 89
• 11
• 10
• ### Forum Statistics

• Total Topics
632973
• Total Posts
3009619
• ### Who's Online (See full list)

There are no registered users currently online

×