Ejemplo n.º 1
0
void gui_el_t6::draw(float dx, float dy, int8_t plane)
{
    if (flt > 0)
        draw_f(dx,dy,plane);
    else
        draw_d(dx,dy,plane);
}
Ejemplo n.º 2
0
void gui_el_t6::draw(int8_t plane)
{
    if (flt > 0)
        draw_f(0,0,plane);
    else
        draw_d(0,0,plane);
}
Ejemplo n.º 3
0
void draw_table(void)
{
    float c;
    int i, j;
    int k, l;
    float ov[3], lv[3];

    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);

    ov[X] = light_pos[X]-logo_pos[X];
    ov[Y] = light_pos[Y]-logo_pos[Y];
    ov[Z] = light_pos[Z]-logo_pos[Z];

    normalize(ov);

    for (j=0; j<=TABLERES; j++) {
      for (i=0; i<=TABLERES; i++) {
	lv[X] = light_pos[X] - table_points[j][i][X];
	lv[Y] = light_pos[Y] - table_points[j][i][Y];
	lv[Z] = light_pos[Z] - table_points[j][i][Z];
	normalize(lv);
	if ((c = dot(lv, ov))<0.0) c = 0.0;
	c = c * c * c * lv[Y] * 255.0;
	/* fade */
	if ((current_time>TIME-5.0) && (current_time<TIME-3.0)) 
	  c *= 1.0 - (current_time-(TIME-5.0)) * 0.5;
	
	tablecolors[j][i] = (int)c;
      }
    }
    
    
    for (l=0; l<TABLERES; l++) {
      
      glBegin(GL_TRIANGLE_STRIP);
      for (k=0; k<=TABLERES; k++) {
	glColor3ub(tablecolors[l][k],
		   tablecolors[l][k],
		   tablecolors[l][k]);
	glVertex3fv(table_points[l][k]);

	glColor3ub(tablecolors[l+1][k],
		   tablecolors[l+1][k], 
		   tablecolors[l+1][k]);
	glVertex3fv(table_points[l+1][k]);
	
      }
	glEnd();
    }

    if (logo_pos[Y]>-0.33 && logo_pos[Y]<0.33) {
	glEnable(GL_DEPTH_TEST);
    }

    pca = 0.0;
    glBegin(GL_POLYGON);
    for (i=0; i<4; i++) {
      lv[X] = light_pos[X] - paper_points[i][X];
      lv[Y] = light_pos[Y] - paper_points[i][Y];
      lv[Z] = light_pos[Z] - paper_points[i][Z];
      normalize(lv);
      if ((c = dot(lv, ov))<0.0) c = 0.0;
      c = c * c * c * lv[Y];
      /* fade */
      if ((current_time>TIME-5.0) && (current_time<TIME-3.0)) 
	c *= 1.0 - (current_time-(TIME-5.0)) * 0.5;
      
      pcr = c * 255; pcg = c * 255; pcb = c * 200;
      pca += c;
      glColor3ub((GLubyte)pcr,  (GLubyte)pcg,  (GLubyte)pcb);
      glVertex3fv(paper_points[i]);
    }
    glEnd();

    glPushMatrix();
    glRotatef (0.1 * (-184), 0.0, 1.0, 0.0);
    glTranslatef(-0.3, 0.0, -0.8);
    glRotatef (0.1 * (-900), 1.0, 0.0, 0.0);
    glScalef(0.015, 0.015, 0.015);


    if (current_time>TIME*1.0-5.0) {
	c = (current_time-(TIME*1.0-5.0))/2.0;
	glColor3ub((GLubyte)(c*255.0),  (GLubyte)(c*255.0),  (GLubyte)(c*255.0));
    } else glColor3ub(0,  0,  0);

    glDisable(GL_DEPTH_TEST);

    draw_i();
    glTranslatef(3.0,  0.0,  0.0);

    draw_d();
    glTranslatef(6.0,  0.0,  0.0);

    draw_e();
    glTranslatef(5.0,  0.0,  0.0);

    draw_a();
    glTranslatef(6.0,  0.0,  0.0);

    draw_s();
    glTranslatef(10.0,  0.0,  0.0);

    draw_i();
    glTranslatef(3.0,  0.0,  0.0);

    draw_n();
    glTranslatef(-31.0,  -13.0,  0.0);

    draw_m();
    glTranslatef(10.0,  0.0,  0.0);

    draw_o();
    glTranslatef(5.0,  0.0,  0.0);

    draw_t();
    glTranslatef(4.0,  0.0,  0.0);

    draw_i();
    glTranslatef(3.5,  0.0,  0.0);

    draw_o();
    glTranslatef(5.0,  0.0,  0.0);

    draw_n();

    glPopMatrix();

}