#!/usr/bin/nawk -f $0
BEGIN {
# printf("%d %d\n",ARGC,ARGV[1]);

  num_frames=int(256/2);
  num_verts = 9

  if(ARGC >= 2) {
    scale = 1;
  }
  else {
    scale = 0.03;
  }
  pi = atan2(0,-1);

  printf("%d %d %d\n",num_frames,num_verts,0); 

  theta[0]=    0.0; r[0]=  1.0;
  theta[1]=    0.0; r[1]=  0.5;
  theta[2]=    0.0; r[2]=  0.8;
  theta[3]=   45.0; r[3]=  0.5;
  theta[4]=  135.0; r[4]=  0.5;
  theta[5]=  180.0; r[5]=  0.9;
  theta[6]= -135.0; r[6]=  0.5;
  theta[7]=  -45.0; r[7]=  0.5;
  theta[8]=    0.0; r[8]=  0.8;

  red = green = blue = 255

  for(k=0;k<num_frames;k++) {
    for(j=0;j<num_verts;j++) {
      s = sin(2*pi*(k/num_frames+theta[j]/360))
      c = cos(2*pi*(k/num_frames+theta[j]/360))

      x = (r[j] * -s)*scale
      y = (r[j] * c)*scale

      printf("%d %f %f %f %02x%02x%02x\n",flags,x,y,z,red,green,blue);
    }
  }
  exit(0);
}
