Results 1 to 3 of 3

Thread: yet another problem with texture mapping

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    bxl
    Posts
    4

    yet another problem with texture mapping

    Hi,

    I'm trying to do some texture mapping on some quads and triangles but no texture seems to be mapped on my objects.

    I'm using the Paul's tgaloader, and i think i'm using the same properties for blending, smoothing,lighting,... as the 5th paul's tutorial.

    But my program has 2 screens with gluortho2D plus a 3D window.

    Does it come from my program features or did i make a huge mistake ?

    thx

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: yet another problem with texture mapping

    Post us a little code. Do you have texture 2d enabled? Does it work if you just have texturing enabled (without blending) - are your primitives black or whatever?

    More information required.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    bxl
    Posts
    4

    Re: yet another problem with texture mapping

    I tried without blending and it still doesn't work

    GLUT_TEXTURE_2D is enabled

    some sample:

    void traceRectangle(GLuint nom, GLuint x, GLuint y, GLuint scale, float* couleur)
    {
    GLfloat rect_scale = 7 ;

    glEnable(GL_TEXTURE_2D);
    glDisable(GL_LIGHTING);

    if (Sel_mode==GL_SELECT)
    glLoadName(nom);


    glTranslatef(x, y, 0.0);


    glScalef(scale/rect_scale, scale/rect_scale, scale/rect_scale);

    if (nom == __PLANCHE)
    glBindTexture(GL_TEXTURE_2D, texture_id[1]);
    else
    glBindTexture(GL_TEXTURE_2D, texture_id[2]);


    glBegin(GL_QUADS);
    glColor3f(couleur[0], couleur[1], couleur[2]);
    glTexCoord2f(0.0, 0.0); glVertex2f(-1.0, -0.5);
    glTexCoord2f(1.0, 0.0); glVertex2f(1.0, -0.5);
    glTexCoord2f(1.0, 1.0); glVertex2f(1.0, 0.5);
    glTexCoord2f(0.0, 1.0); glVertex2f(-1.0, 0.5);
    glEnd();

    glEnable(GL_LIGHTING);

    glDisable(GL_TEXTURE_2D);
    }

Similar Threads

  1. Replies: 1
    Last Post: 01-10-2005, 09:50 AM
  2. Replies: 0
    Last Post: 01-09-2005, 06:01 PM
  3. Replies: 0
    Last Post: 01-09-2005, 05:53 PM
  4. Replies: 1
    Last Post: 01-09-2005, 05:50 PM
  5. Texture mapping problem
    By occamrzr in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 01-15-2001, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean