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 viral
1
 
void TriangleTwo(void)
{
float AngleIII;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glRotatef(AngleIII, 0.0, 1.0, 0.0);
glBegin(GL_TRIANGLES);

glColor3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);    // Top(Front)
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1.0, -1.0, 1.0);  // Left(Front)
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1.0, -1.0, 1.0);   // Right(Front)

glColor3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);    // Top(Right)
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1.0, -1.0, 1.0);   // Left(Right)
glColor3f(0.0, 1.0, 0.0);
glVertex3f(1.0, -1.0, -1.0);  // Right(Right)

glColor3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);    // Top(Back)
glColor3f(0.0, 1.0, 0.0);
glVertex3f(1.0, -1.0, -1.0);  // Left(Back)
glColor3f(0.0, 0.0, 1.0);
glVertex3f(-1.0, -1.0, -1.0); // Right(Back)

glColor3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);    // Top(Left)
glColor3f(0.0, 0.0, 1.0);
glVertex3f(-1.0, -1.0, -1.0); // Left(Left)
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1.0, -1.0, 1.0);  // Right(Left)
AngleIII += 0.5;
}