Jump to content
  • Advertisement
Sign in to follow this  
medium147

OpenGL Problem with opengl

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Could you explain the problem a bit more?
I don't know if i understand the problem but I suggest that you draw 6 polygons instead of 1.

Share this post


Link to post
Share on other sites
You could also make the texture standalone, and then make several textures on one polygon by specifying coordinates higher than 1.0:
glTexCoord2f(3.0f, 2.0f); // 3x2 times the same texture

Share this post


Link to post
Share on other sites
If I understand you correctly, you want to repeat a texture 6 times across a polygons surface. In this case, you set the texture s and t wrapping modes to GL_REPEAT, for the texture you want. So:

glBindTexture( texture_id );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
Then, you need to set the largest extent of the texture coordinate to 6, so, for example, if you were texturing a quad, you'd give it the texture coordinates:

[0.0, 6.0] [6.0, 6.0]
+-----------+
| |
| |
+-----------+
[0.0, 0.0] [6.0, 0.0]

Share this post


Link to post
Share on other sites
If you want to repeat the entire texture, then just pass in texture coordinates between 0 and 6 (and set the wrap mode to repeat).

If you want to repeat only a part of the texture, you have to tesselate the polygon and keep repeating the texture coordinates you're interested in. Unless you're on a PlayStation 2 :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!