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 6911839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:00:32+00:00 2026-05-27T09:00:32+00:00

I have a an odd problem with some texturing in opengl: This scene is

  • 0

I have a an odd problem with some texturing in opengl:

enter image description here

This scene is comprised of an open box composed of 4 textured quadrics (floor and 3 walls) and some crude mushrooms made from gluSpheres that have been translated, scaled and textured respectively.

If you look specifically at the floor, you’ll see that half of the quadric has had it’s texture massively warped, I have triple checked the texture coordinates for the floor, and there appears to be nothing wrong with them (as you can see, the other three walls are fine and they follow the same pattern as the floor). This happens with any texture that I use (I’m just using RAW RGB data).

I take my mushrooms out of the scene and the warping goes away, it’s really bizzare. Has anyone seen this before? i’m relatively new to opengl, so I didn’t know what to look for when I saw this. Thanks in advance.

Edit:

Code for the box:

    void drawRoom(void) {
        glPushMatrix();
            glScalef(10,10,10);
            GLuint texture = LoadTextureRAW("cave_two.raw",1);
            glEnable(GL_TEXTURE_2D);
            glBegin(GL_QUADS);

            //Floor
            glVertex3f(-1,-1,-1); glTexCoord2f(0,0); glNormal3f(0,1,0);
            glVertex3f(1,-1,-1); glTexCoord2f(1,0); glNormal3f(0,1,0);
            glVertex3f(1,-1,1); glTexCoord2f(1.0,1.0); glNormal3f(0,1,0);
            glVertex3f(-1,-1,1); glTexCoord2f(0.0,1.0); glNormal3f(0,1,0);


            //Back wall
            glVertex3f(-1,-1,-1); glTexCoord2f(0,0); glNormal3f(0,0,1);
            glVertex3f(1,-1,-1); glTexCoord2f(1,0); glNormal3f(0,0,1);
            glVertex3f(1,1,-1); glTexCoord2f(1.0,1.0); glNormal3f(0,0,1);
            glVertex3f(-1,1,-1); glTexCoord2f(0.0,1.0); glNormal3f(0,0,1);

            //Right wall
            glVertex3f(1,1,1); glTexCoord2f(0,0); glNormal3f(-1,0,0);
            glVertex3f(1,-1,1); glTexCoord2f(1,0); glNormal3f(-1,0,0);
            glVertex3f(1,-1,-1); glTexCoord2f(1.0,1.0); glNormal3f(-1,0,0);
            glVertex3f(1,1,-1); glTexCoord2f(0.0,1.0); glNormal3f(-1,0,0);

            //Left wall
            glVertex3f(-1,1,1); glTexCoord2f(0,0); glNormal3f(1,0,0);
            glVertex3f(-1,-1,1); glTexCoord2f(1,0); glNormal3f(1,0,0);
            glVertex3f(-1,-1,-1); glTexCoord2f(1.0,1.0); glNormal3f(1,0,0);
            glVertex3f(-1,1,-1); glTexCoord2f(0.0,1.0); glNormal3f(1,0,0);

            glEnd();
            glDisable(GL_TEXTURE_2D);
            glDeleteTextures( 1, &texture );
        glPopMatrix();
        }
  • 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-27T09:00:33+00:00Added an answer on May 27, 2026 at 9:00 am

    Without seeing the code, all we can do is wild guesses. Here’s mine.

    I suspect that you specify a vertex first (glVertex*), and the texture coordinates for that vertex second (glTexCoord*). This is the wrong way round: the texcoords become part of the state, and get applied to all subsequently drawn vertices. With a texture like this, you wouldn’t notice that it is actually 90 degrees rotated.

    Furthermore, I suspect you draw the mushrooms first, and the box second. Then, the first vertex of the box receives the texcoord that the last mushroom happened to use on its last vertex, which happened to be wrong. Without the shrooms, it gets the last texcoord from the last box face, which happened to be correct.

    You might also want to specify GL_LINEAR_MIPMAP_LINEAR instead of GL_LINEAR_MIPMAP_NEAREST to make the mipmapping artifacts go away, since now there’s a clear edge between where the 0th and 1st level mipmap are used.

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

Sidebar

Related Questions

I have the odd problem that I am not able to open the properties
I have this odd problem with a third party script. On our site a
I'm using PuTTY to log into a Debian server. I have this odd problem
This is my first question on S.O. I have a very odd problem. Below
I am seeing this somehow odd problem (even though I have the feeling I
I have this odd problem with Spring AOP and I am hoping someone can
This is an odd problem. I have a client object that I am building
I have an odd problem...I'm using a documentation generator which generates a lot of
I have an odd problem in VS2008 running unit tests. When I run the
I have an odd problem with Django. I have a set of objects that

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.