PDA

View Full Version : Setting the repeat in U and V



molmsted
09-13-2001, 08:11 AM
I am attempting to edit some OpenGL code for use in the 3D package Maya 4.0. What I am wanting to do is set the repeat in U and V for a texture. From the Maya GUI, you can set the options in a float format, but how do I tell OpenGL to use these attributes to set repeat in U and V? This isn't directly related to Maya and should not be API specific.

ppinter1
09-13-2001, 10:27 AM
How about:




glTexParameterf (GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameterf (GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);

Where S and T are OpenGL's names for U and V.


[This message has been edited by ppinter1 (edited 09-13-2001).]

[This message has been edited by ppinter1 (edited 09-13-2001).]

[This message has been edited by ppinter1 (edited 09-13-2001).]

zed
09-13-2001, 01:03 PM
glTexCoord2f(1,1)
will stick the whole texture over the polygon
glTexCoord2f(2,5)
will repeat it twice in the u direction + 5x in the v direction