Exemple #1
0
void  display(void) 
{ 
  int i,ix,iy, ix1,iy1; 
  double t; 

  glClear(GL_COLOR_BUFFER_BIT); 
  for( i=0; i<16; i++ ){  
    t = (float)i*22.5*3.1415926545867932/180.;
    ix = (int)(300.*cos(t)) + width/2;
    iy = (int)(300.*sin(t)) + height/2;
    //if(8<=i && i<=12)
    linei( width/2, height/2, ix, iy ); // 中心から放射状に16方向に直線を引く    
  } 
  circlei( width/2,width/2,width/2 ); // ウィンドウ幅の直径の円を描く
  glFlush(); 
} 
Exemple #2
0
void  display(void)
{
  int i,ix,iy, ix1,iy1;
  double a=1.995128, y0=0., y2, x1=0.069756;
  double b=1.989043, x0=0., x2, y1=0.104528;
  double mag;

  glClear(GL_COLOR_BUFFER_BIT);
  mag = width/3;
  ix = width/2;  iy = height/2;
  for( i=0; i<180; i++ ){
    ix1 = (int)(x1*mag) + width/2;
    iy1 = (int)(y1*mag) + height/2;
    linei( ix,iy,ix1,iy1 );
    x2 = a*x1-x0;  x0 = x1; x1 = x2;ix = ix1;
    y2 = b*y1-y0;  y0 = y1; y1 = y2;iy = iy1;
  }
  circlei( ix,iy,iy/4 );
  glFlush();
}