GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by Anonymous
1
 
oid DrawFloor ( )
{
    float width = 10;
    float y = -2.0f;
    float step = 0.1f;
    for (float x = 0; x < width; x += step)
    {
        glBegin(GL_TRIANGLE_STRIP);
            for (float z = 0; z < width; z += step)
            {
                glTexCoord2f ( x/width, z/width );
                glVertex3f(x, y, z);

                glTexCoord2f ( (x+1)/width, z/width );
                glVertex3f(x + step, y, z);
            }
        glEnd();
    }
}