Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Texture Map coordinates

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2008
    Posts
    14

    Texture Map coordinates

    Hi, below is my code and texture not showing. please help. thanks

    yConst = -300;
    for (x=-300; x < 300; x+=5)
    for (z=600; z > -600; z-=5)
    {
    glTexCoord3f(0.0,1.0); glVertex3f( x, yConst, z); //Top Left glTexCoord3f(0.0,0.0); glVertex3f(x+5, yConst, z);// Bottom Left glTexCoord3f(1.0,0.0); glVertex3f(x+5, yConst, z-5);// Bottom Right
    glTexCoord3f(1.0,1.0); glVertex3f( x, yConst, z-5);// Top Right
    }

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,370

    Re: Texture Map coordinates

    The above code is not the whole necessary code to display a texture and should not even compile since you call glTexCoord3f with 2 parameters and it takes 3 ones.

    Moreover, glBegin/glEnd calls lack or are not included in the above piece of code IMO.

    For more information about texture mapping, read this if it is not already done:
    http://www.opengl.org/wiki/index.php/Texture_Mapping

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •