Results 1 to 2 of 2

Thread: Texture-On , Texture-Off Why ?

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    15

    Texture-On , Texture-Off Why ?

    Hi ,

    Why this happend ? ,the teapot work fine and ather objects dont ?

    im lost ! HELP !!!!!!

    void OnRender()
    {

    static GLfloat fAngle=-5;
    glClear(GL_COLOR_BUFFER_BIT);
    glEnable(GL_TEXTURE_2D);
    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);
    glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DE CAL);
    glTexImage2D(GL_TEXTURE_2D, 0, 3, pBmpinfo->bmiHeader.biWidth,
    pBmpinfo->bmiHeader.biHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, pBit);

    glPushMatrix();
    glTranslatef(0.0, 0.0, -20.0);
    glRotatef(fAngle,0,1,0);

    if(WantToGetCrazy==TRUE)
    {
    glutSolidCube(5); //why here the texture dont work ???
    glutSolidSphere(5,50,50); //and also here
    }
    else
    glutSolidTeapot(5.0); // in same code ....this work fine !!!!!!!!

    glutSwapBuffers();
    glPopMatrix();

    fAngle-=5;

    }
    Arie

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Re: Texture-On , Texture-Off Why ?

    This is because, in the GLUT implementation, only glutSolidTeapot has predefined texture coordinates. The rest like glutSolidSphere do not have texture-coordinates specified by glut.
    :: Sleep is a poor substitute for caffeine ::

Similar Threads

  1. Replies: 1
    Last Post: 12-26-2014, 04:57 PM
  2. Replies: 1
    Last Post: 03-10-2014, 12:51 PM
  3. Replies: 0
    Last Post: 01-09-2005, 06:01 PM
  4. Replies: 0
    Last Post: 01-09-2005, 05:53 PM
  5. Replies: 2
    Last Post: 09-27-2004, 05:25 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