Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <GL/glut.h>
- //
- //void shapes (void) {
- // double x=.12,y=.12,w1,w2,w3,h1,h2;
- // int i;
- // for(i=0;i<14;i++)
- // {
- // glBegin(GL_TRIANGLES);
- // if(i==0)
- // {
- // glColor3f(1.0, 0.0, 0.0);
- // w1=x*0;
- // w2=x*16;
- // w3=x*8; //1st T
- // h1=y*0;
- // h2=y*8;
- // }
- // if(i==1)
- // {
- // glColor3f(0.0, 1.0, 0.0);
- // w1=x*4;
- // w2=x*12;
- // w3=x*8; //2nd T
- // h1=y*4;
- // h2=y*0;
- // }
- // if(i==2)
- // {
- // glColor3f(0.0, 0.0, 1.0);
- // w1=x*6;
- // w2=x*10; //3rd T
- // w3=x*8;
- // h1=y*6;
- // h2=y*4;
- // }
- // if(i==3)
- // {
- // glColor3f(0.0, 1.0, 1.0);
- // w1=x*2;
- // w2=x*6; //4th T
- // w3=x*4;
- // h1=y*2;
- // h2=y*0;
- // }
- // if(i==4)
- // {
- // glColor3f(1.0, 0.0, 1.0);
- // w1=x*10;
- // w2=x*14; //5th T
- // w3=x*12;
- // h1=y*2;
- // h2=y*0;
- // }
- // if(i==5)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*1;
- // w2=x*3; //6th T
- // w3=x*2;
- // h1=y*1;
- // h2=y*0;
- // }
- // if(i==6)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*5;
- // w2=x*7; //7th T
- // w3=x*6;
- // h1=y*1;
- // h2=y*0;
- // }
- // if(i==7)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*9;
- // w2=x*11; //8th T
- // w3=x*10;
- // h1=y*1;
- // h2=y*0;
- // }
- // if(i==8)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*13;
- // w2=x*15; //9th T
- // w3=x*14;
- // h1=y*1;
- // h2=y*0;
- // }
- // if(i==9)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*3;
- // w2=x*5; //10th T
- // w3=x*4;
- // h1=y*3;
- // h2=y*2;
- // }
- // if(i==10)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*11;
- // w2=x*13; //11th T
- // w3=x*12;
- // h1=y*3;
- // h2=y*2;
- // }
- // if(i==11)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*5;
- // w2=x*7; //12th T
- // w3=x*6;
- // h1=y*5;
- // h2=y*4;
- // }
- // if(i==12)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*9;
- // w2=x*11; //13th T
- // w3=x*10;
- // h1=y*5;
- // h2=y*4;
- // }
- // if(i==13)
- // {
- // glColor3f(1.0, 1.0, 0.0);
- // w1=x*7;
- // w2=x*9; //14th T
- // w3=x*8;
- // h1=y*7;
- // h2=y*6;
- // }
- //
- // glVertex2f(w1,h1);
- // glVertex2f(w2,h1);
- // glVertex2f(w3,h2);
- // glEnd();
- // }
- //}
- //
- //void display (void) {
- //
- // // clearing the window with black color, 1st 3 parameter are for R,G,B. last one for opacity
- // glClearColor (0.0,0.0,0.0,1.0);
- // glClear (GL_COLOR_BUFFER_BIT);
- // glLoadIdentity();
- // //viewing transformation
- // //glulookat() positions the camera towards the object
- // //camera position, camera target, upvector
- // gluLookAt (0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
- // shapes();
- // glFlush();
- //}
- //
- //void reshape (int w, int h) {
- //
- // // 1st 2 parameters for lower left corner of the viewport rectangle. the default is 0,0
- // // the next coordinates are width and hight of the viewport
- ////Set the viewport to be the entire window
- // glViewport (0, 0, (GLsizei)w, (GLsizei)h);
- //
- // // setting the camera
- // glMatrixMode (GL_PROJECTION);
- // glLoadIdentity ();
- //
- // //perspective transform
- // //gluPerspective (30, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
- // gluPerspective (30, 1, 1.0, 100.0);
- // glMatrixMode (GL_MODELVIEW); //switch back the the model editing mode.
- //
- //}
- //
- //int main (int argc, char **argv) {
- // glutInit (&argc, argv);
- // glutInitDisplayMode (GLUT_SINGLE); // single buffering.. (double buffering for animation)
- // // full screen is 1000,1000
- // // this 0,0 or 1000,1000 are world co ordinates
- // glutInitWindowSize (1000, 1000);
- // glutInitWindowPosition (100, 100);
- // glutCreateWindow ("A basic OpenGL Window");
- // // registering callback functions
- // glutDisplayFunc (display);
- // glutReshapeFunc (reshape);
- //
- // glutMainLoop ();
- // return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement