- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- gluPerspective(45.0, Panel1.width/Panel1.Height, NearClipping, FarClipping);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity;
- g:=strtoint(edit1.text);
- x:=strtoint(edit2.text);
- y:=strtoint(edit3.text);
- z:=strtoint(edit4.text);
- //glrotatef(g,x,y,z);
- glTranslatef(0, 0, -5);
- glrotatef(g,x,y,z);
- glBegin(GL_QUADS);
- glColor3f(1, 0, 1); glVertex3f(-0.5, -0.5, 0); //vorne
- glVertex3f(-0.5, 0.5, 0);
- glVertex3f(0.5, 0.5, 0);
- glVertex3f(0.5, -0.5, 0);
- glColor3f(0, 1, 0); glVertex3f(-0.5, 0.5, 0); //oben
- glVertex3f(0.5, 0.5, 0);
- glVertex3f(0.5, 0.5, 1);
- glVertex3f(-0.5, 0.5, 1);
- glColor3f(0, 0, 1); glVertex3f(0.5, -0.5, 0); //rechts
- glVertex3f(0.5, -0.5, 1);
- glVertex3f(0.5, 0.5, 1);
- glVertex3f(0.5, 0.5, 0);
- glColor3f(0, 1, 0); glVertex3f(-0.5, -0.5, 0); //unten
- glVertex3f(-0.5, -0.5, 1);
- glVertex3f(0.5, -0.5, 1);
- glVertex3f(0.5, -0.5, 0);
- glColor3f(0, 0, 1); glVertex3f(-0.5, -0.5, 0); //links
- glVertex3f(-0.5, -0.5, 1);
- glVertex3f(-0.5, 0.5, 1);
- glVertex3f(-0.5, 0.5, 0);
- glColor3f(1, 1, 1); glVertex3f(-0.5, -0.5, 1); //hinten
- glVertex3f(0.5, -0.5, 1);
- glVertex3f(0.5, 0.5, 1);
- glVertex3f(-0.5, 0.5, 1);
- glend;