void desenhaMinhoca (int ciclo) { desenhaTerra(); if (ciclo > 45) { desenhaCirculo(0, 0, 0.06); glColor3f(1, 0.8, 0.8); desenhaCirculo(0, 0, 0.04); if (ciclo < 50) for (float i = -0.15; i <= 0.15; i += 0.3) for (float j = -0.15; j <= 0.15; j += 0.3) { glColor3f(0.5, 0.2, 0.1); desenhaCirculo(j, i, 0.01); glColor3f(0, 0, 0); desenhaCircunferencia(j, i, 0.01); } else { glPushMatrix(); int numero0a3 = (ciclo/10)%4; glRotatef(numero0a3 * 90, 0, 0, 1); glColor3f(1, 0.8, 0.8); desenhaQuadrilatero(-0.04, 0, 0.04, 0, 0.04, -0.11, -0.04, -0.11); desenhaCirculo(0, -0.11, 0.04); glColor3f(1, 0, 0); desenhaLinha(-0.04, 0.00, 0.04, 0.00, 2); desenhaLinha(-0.04, -0.05, 0.04, -0.05, 2); desenhaLinha(-0.04, -0.10, 0.04, -0.10, 2); glPopMatrix(); } } }
void desenhaCacto () { glColor3f(0, 0.4, 0); desenhaQuadrilatero(-0.1, 0.03, 0.1, 0.03, 0.1, -0.03, -0.1, -0.03); glColor3f(0, 0.6, 0); desenhaCirculo(0, 0, 0.05); desenhaCirculo(-0.1, 0, 0.03); desenhaCirculo(0.1, 0, 0.03); }
void desenhaToco () { glColor3f(0.4, 0.27, 0.07); desenhaQuadrilatero(-0.03, 0.03, 0.13, 0.16, 0.03, -0.03, -0.13, -0.16); desenhaQuadrilatero(-0.03, -0.03, 0.13, -0.16, 0.03, 0.03, -0.13, 0.16); glColor3f(0.55, 0.27, 0.07); desenhaCirculo(0, 0, 0.08); glColor3f(0.65, 0.65, 0.15); desenhaCirculo(0, 0, 0.07); glColor3f(0.55, 0.27, 0.07); desenhaCircunferencia(0, 0, 0.06); desenhaCircunferencia(0, 0, 0.04); desenhaCircunferencia(0, 0, 0.02); }
void desenhaCobra () { glColor3f(0.1, 0, 0.3); desenhaQuadrilatero(0.08, 0, 0.1, 0, 0.1, 0.2, 0.08, 0.2); desenhaTriangulo(0.08, 0.2, 0.1, 0.2, 0.09, 0.25); for (float i = 0.02; i < 0.12; i += 0.02) { glColor3f(5*i, 0, 0.3); desenhaCirculo(0, 0, 0.12-i); glColor3f(0, 0, 0); desenhaCircunferencia(0, 0, 0.12-i); } glColor3f(1, 0, 0); desenhaLinha(0, -0.1, 0, -0.2, 2); desenhaLinha(0, -0.2, -0.01, -0.21, 2); desenhaLinha(0, -0.2, 0.01, -0.21, 2); glColor3f(0.5, 0, 0.3); desenhaElipse(0, -0.05, 0.07, 0.05); desenhaElipse(0, -0.1, 0.03, 0.06); glColor3f(0.2, 0, 0.3); desenhaElipse(-0.015, -0.115, 0.01, 0.005); desenhaElipse(0.015, -0.115, 0.01, 0.005); }
void Pedra(GLfloat X, GLfloat Y, GLfloat escala, float translacaoX, float translacaoY){ glPushMatrix(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-100, 100, -100, 100); glScalef(escala, escala, 0); glTranslatef(translacaoX + variacaoX, translacaoY, 0); glColor3f(1, 1, 1); desenhaCirculo(5, 8+X, 6+Y); desenhaCirculo(5, 4+X, 4+Y); desenhaCirculo(4, 9+X, 3+Y); desenhaCirculo(3, 5+X, 0+Y); desenhaCirculo(5, 5+X, 0+Y); glPopMatrix(); glFlush(); }
void desenhaUrso () { glColor3f(0.9, 0.9, 0.9); desenhaQuadrilatero(-0.1, -0.125, 0.1, -0.125, 0.1, 0.125, -0.1, 0.125); desenhaCirculo(0, 0.125, 0.1); desenhaCirculo(0, 0.275, 0.02); desenhaElipse(-1/15.0, -0.125, 1/30.0, 0.125); desenhaElipse( 1/15.0, -0.125, 1/30.0, 0.125); glColor3f(1, 1, 1); desenhaCirculo(0, -0.1, 0.06); desenhaCirculo( 0.05, -0.05, 0.02); desenhaCirculo(-0.05, -0.05, 0.02); desenhaElipse(0, -0.17, 0.03, 0.0675); glColor3f(0, 0, 0); desenhaTriangulo(-0.015, -0.21, 0.015, -0.21, 0, -0.23); desenhaLinha(-0.03, -0.15, -0.01, -0.15, 1); desenhaLinha(0.03, -0.15, 0.01, -0.15, 1); }
void desenhaTerra () { glColor3f(0, 0, 0); desenhaQuadrilatero(-0.1, -0.1, -0.1, 0.1, 0.1, 0.1, 0.1, -0.1); for (float i = -0.1; i < 0.12; i += 0.025) for (float j = -0.1; j < 0.12; j += 0.02) { glColor3f(0.5, 0.2, 0.1); desenhaCirculo(j, i, 0.01); glColor3f(0, 0, 0); desenhaCircunferencia(j, i, 0.01); } }
void desenhaPonto(){ printf("Clearing screen\n"); glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glPointSize(point_size); glBegin(GL_POINTS); desenhaCirculo(lastCoords.pxa,lastCoords.pxb,RADIUS); glEnd(); glFlush(); }
void desenhaLekinho (/*int anguloMovimento*/) { glPushMatrix(); //glRotatef(anguloMovimento, 1, 0, 0); glColor3f(1, 0.8, 0.6); desenhaQuadrilatero(0.05, 0, 0.07, 0, 0.07, 0.08, 0.05, 0.08); //braço direito desenhaCirculo(0.06, 0.08, 0.015); glColor3f(0, 0, 0.7); desenhaQuadrilatero(-0.01, 0, -0.04, 0, -0.04, 0.1, -0.01, 0.1); //perna esquerda glColor3f(0.55, 0.27, 0.07); desenhaElipse(-0.025, 0.1, 0.02, 0.02); glPopMatrix(); glPushMatrix(); //glRotatef(-anguloMovimento, 1, 0, 0); glColor3f(1, 0.8, 0.6); desenhaQuadrilatero(-0.05, 0, -0.07, 0, -0.07, -0.08, -0.05, -0.08); //braço esquerdo desenhaCirculo(-0.06, -0.08, 0.015); glColor3f(0, 0, 0.7); desenhaQuadrilatero(0.01, 0, 0.04, 0, 0.04, -0.1, 0.01, -0.1); //perna direita glColor3f(0.55, 0.27, 0.07); desenhaElipse(0.025, -0.1, 0.02, 0.02); glPopMatrix(); glColor3f(1, 0, 0); desenhaElipse(0, 0, 0.07, 0.03); glColor3f(0, 0, 0); desenhaCirculo(0, 0, 0.03); desenhaTriangulo(-0.015, 0.04, -0.01, 0.07, -0.005, 0.04); desenhaTriangulo(-0.005, 0.04, +0.00, 0.07, +0.005, 0.04); desenhaTriangulo(+0.005, 0.04, +0.01, 0.07, +0.015, 0.04); glColor3f(1, 1, 1); desenhaLinha(-0.01, -0.02, -0.01, 0.02, 1); desenhaLinha(0, -0.02, 0, 0.02, 1); desenhaLinha(0.01, -0.02, 0.01, 0.02, 1); }
void desenhaAreiaMovedica (int ciclo) { glColor3f(0.7, 0.6, 0); desenhaCirculo(0, 0, 0.1); float aux = 0.09; bool aplicarEfeito = (ciclo/5)%2 != 0; if (aplicarEfeito) aux = 0.08; glColor3f(0.5, 0.2, 0); for (float i = aux; i > 0; i -= 0.02) desenhaCircunferencia(0, 0, i); }
void desenhaLeaoMarinho () { desenhaAgua(); glColor3f(0.55, 0.27, 0.07); desenhaElipse(0, 0, 0.15, 0.075); desenhaCirculo(0, 0, 0.08); glColor3f(1, 1, 1); desenhaLinha(-0.05, -0.07, 0.05, -0.07, 1); desenhaLinha(-0.05, -0.08, 0.05, -0.08, 1); desenhaLinha(-0.05, -0.09, 0.05, -0.09, 1); glColor3f(0.65, 0.37, 0.17); desenhaCirculo(-0.01, -0.06, 0.03); desenhaCirculo( 0.01, -0.06, 0.03); desenhaCirculo( 0.00, 0.00, 0.05); glColor3f(0, 0, 0); desenhaElipse( 0.00, -0.105, 0.005, 0.0045); desenhaElipse( 0.04, -0.050, 0.003, 0.0075); desenhaElipse(-0.04, -0.050, 0.003, 0.0075); }
void exibicaoPrincipal(void) { // maindisplay glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluOrtho2D(-20, 20, -20, 20); glMatrixMode (GL_MODELVIEW); glLoadIdentity (); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); SRU(); //desenha circulo glColor3f(0.0f,0.0,1.0);//Azul glPointSize(2.0f); desenhaCirculo(5.0f, 5.0f, 5.0f); desenhaCirculo(5.0f, -5.0f, 5.0f); desenhaCirculo(5.0f, 0.0f, -5.0f); //traça o triangulo entre os centros dos circulos //a - b desenhaReta(-5, 5, 5, 5); desenhaReta(5, 5, 0, -5); desenhaReta(0, -5, -5, 5); glutSwapBuffers(); }
void exibicaoPrincipal(void) { glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluOrtho2D(-20, 20, -20, 20); glMatrixMode (GL_MODELVIEW); glLoadIdentity (); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //desenha circulo glColor3f(0.0f,0.0,0.0); desenhaCirculo(RAIO_EXTERNO,0.f,0.f); calculaQuadrado(RAIO_EXTERNO); desenhaQuadrado(); desenhaJoystick(); glutSwapBuffers(); }
void desenhaPlantaCarnivora (int ciclo) { glColor3f(0, 0.3, 0); desenhaElipse(-0.07, 0, 0.07, 0.075); desenhaElipse( 0.07, 0, 0.07, 0.075); glColor3f(0, 0.6, 0); desenhaCirculo(0, 0, 0.07); bool aplicarEfeito = (ciclo/5)%2 != 0; if (aplicarEfeito) { glColor3f(0.5, 0.7, 0.5); desenhaElipse(0, -0.08, 0.06, 0.025); } else { glColor3f(0.5, 0.7, 0.5); desenhaElipse(0, -0.07, 0.06, 0.045); glColor3f(0, 0, 0); desenhaElipse(0, -0.08, 0.045, 0.035); glColor3f(0.5, 0.7, 0.5); desenhaTriangulo(-0.012, -0.035, 0.000, -0.09, 0.012, -0.035); desenhaTriangulo(-0.024, -0.035, -0.024, -0.09, -0.012, -0.035); desenhaTriangulo( 0.012, -0.035, 0.024, -0.09, 0.036, -0.035); } }
void desenhaSapo () { glColor3f(0, 0.2, 0); desenhaElipse( 0.04, 0.07, 0.02, 0.06); desenhaElipse(-0.04, 0.07, 0.02, 0.06); glColor3f(0, 0.4, 0); desenhaElipse( 0.04, -0.02, 0.02, 0.06); desenhaElipse(-0.04, -0.02, 0.02, 0.06); desenhaCirculo(-0.065, -0.12, 0.005); desenhaCirculo(-0.040, -0.12, 0.005); desenhaCirculo(-0.015, -0.12, 0.005); desenhaCirculo( 0.005, -0.12, 0.005); desenhaCirculo( 0.040, -0.12, 0.005); desenhaCirculo( 0.065, -0.12, 0.005); desenhaTriangulo(-0.04, -0.02, -0.07, -0.12, -0.01, -0.12); desenhaTriangulo( 0.04, -0.02, 0.01, -0.12, 0.07, -0.12); glColor3f(0, 0.6, 0); desenhaElipse(0, 0, 0.05, 0.15); glColor3f(0, 0.4, 0); desenhaElipse(-0.02, -0.064, 0.015, 0.015); desenhaElipse( 0.02, -0.064, 0.015, 0.015); glColor3f(0, 0, 0); desenhaElipse(-0.02, -0.07, 0.01, 0.0075); desenhaElipse( 0.02, -0.07, 0.01, 0.0075); desenhaPonto(-0.005, -0.14); desenhaPonto( 0.005, -0.14); desenhaPonto(-0.010, 0.02); desenhaPonto( 0.010, 0.02); desenhaPonto(-0.010, 0.04); desenhaPonto( 0.010, 0.04); desenhaPonto(-0.010, 0.06); desenhaPonto( 0.010, 0.06); }
void desenhaJoystick() { desenhaCirculo(RAIO_JOYSTICK, posicaoJoystickX, posicaoJoystickY); desenhaPontoCentral(posicaoJoystickX, posicaoJoystickY); }