Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6760461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:04:00+00:00 2026-05-26T14:04:00+00:00

I am a beginner in opengl. I am trying to repeat the texture on

  • 0

I am a beginner in opengl. I am trying to repeat the texture on the GL_QUADS.

So far Here is the code for loading the texture,

    file = os.path.join('image','texture.png')
    surface = image.load(file)

    self.t1 = surface.image_data.create_texture(image.Texture)
    glBindTexture(GL_TEXTURE_2D, t1.id)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)

and drawing

    glBindTexture(GL_TEXTURE_2D, self.t1.id)
    glBegin(GL_QUADS)
    glTexCoord2f(0.0, 0.0); glVertex3f(0, 0, 0)
    glTexCoord2f(1.0, 0.0); glVertex3f(self.width, 0,  0)
    glTexCoord2f(1.0, 1.0); glVertex3f(self.width, self.height, 0)
    glTexCoord2f(0.0, 1.0); glVertex3f(0, self.height,  0)
    glEnd()

When self.width and self.height are changed, the texture is stretched and distorted.

How can I repeat the texture?
Pardon me if i did wrong.

Thank you…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:04:01+00:00Added an answer on May 26, 2026 at 2:04 pm

    How can I repeat the texture? Pardon me if i did wrong.

    By using texture coordinates (glTexCoord) outside the range [0,1].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

iOS beginner here. I'm using the following code to save my facebook accessToken and
Beginner question here. In the .h file of an objective c class.. If you
Absolute beginner question: I have a template file index.html that looks like this: ...
I am a complete beginner trying to develop for FCKeditor so please bear with
As a complete beginner with no programming experience, I am trying to find beautiful
Once again a very beginner-ish question, but here I go: I would like to
I'm looking for simple beginner's tutorial for CUDA with OpenGL, and how to set
Beginner here. Why is this an endless loop ? for (p = 0; p
Beginner programmer here....hope it makes sense :) I have created a console app that
Beginner question here. I'm going to make a Jquery function that is used to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.