void onInitialization() { //szintek letrehozasa //felso szint fieldElements[0][0] = Point2D(-1.0, 0.40); fieldElements[0][1] = Point2D(-0.6, 0.40); fieldElements[1][0] = Point2D(-0.2, 0.40); fieldElements[1][1] = Point2D(0.2, 0.40); fieldElements[2][0] = Point2D(0.6, 0.40); fieldElements[2][1] = Point2D(1.0, 0.40); //kozepso szint fieldElements[3][0] = Point2D(-1.0, -0.30); fieldElements[3][1] = Point2D(-0.6, -0.30); fieldElements[4][0] = Point2D(-0.2, -0.30); fieldElements[4][1] = Point2D(0.2, -0.30); fieldElements[5][0] = Point2D(0.6, -0.30); fieldElements[5][1] = Point2D(1.0, -0.30); //also szint vegig fieldElements[6][0] = Point2D(-1.0, -1.00); fieldElements[6][1] = Point2D(1.0, -1.0); Point2D nose(-0.00, 0.44); Color c; //zöld giliszta c.set(0.0, 1.0, 0.0); initWorm(greenWorm, nose, c); //piros giliszta nose.X() = -0.00; nose.Y() = -0.26; c.set(1.0, 0.0, 0.0); initWorm(redWorm, nose, c); redWorm.setDir(); }
void head(void) { glColor3f(1.0f, 0.0f, 0.0f); //color the face red glTranslatef(0.0, 5.5, -7.5); //position the face, from the torso coordinate frame glScalef(2.0, 2.0, 2.0); drawCube(); //draw face cube and then every feature from this coordinate frame //all facial features are yellow glPushMatrix(); leye(); //draw left eye glPopMatrix(); glPushMatrix(); reye(); //draw right eye glPopMatrix(); glPushMatrix(); nose(); //draw nose glPopMatrix(); glPushMatrix(); mouth(); //draw mouth glPopMatrix(); }