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:: Add Line Numbers


problem by banshee23
void display ( void )   // Create The Display Function
{    
    i = 0;
    
    float tex1 = 0.0;
    float tex = 1.0;
    
    
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);    // Clear Screen And Depth Buffer
    glLoadIdentity();                                    // Reset The Current Modelview Matrix
    glPushMatrix();
    //glTranslatef(XPOS,YPOS,ZPOS);    // Move Left 1.5 Units And Into The Screen 6.0
    gluPerspective(60, 1.0, 1.0, 10000.0);
    gluLookAt  ( 0.0, 0.0, ZPOS, 
                 0.0, MOUSE_Y, 0.0, 
                 0.0, 1.0, 0.0); 
    
    //glRotatef(MOUSE_X,MOUSE_Y, 0.0, 0.0);
    glBegin(GL_TRIANGLES);    
    while(i <= max_vertices)
    {        
        
        glTexCoord2f(i + 0.5, i + 0.5);
        //glColor3f(data[0],data[i+1],data[0]);
        glVertex3f(data[i],data[i+1],data[i+2]);    
        i = i + 3;    
    }
    glEnd();                                                    // Done Drawing The triangles
    glPopMatrix();
    glutSwapBuffers ( );
    //gravity(); //Call gravity
}