Generative Modeling System


Basic System

#define NVPTS 4
#define MAXPTS 2048
Vector3 g[MAXPTS];

int read_curve(void)
{
  int  k = 0;
  while (scanf("%lf %lf %lf\n" ,&(g[k].x),&(g[k].y),&(g[k].z)) != EOF)
    if (k++ > MAXPTS)
      break;
  return k;
}

main(int argc, char **argv)
{
  int nu, nv = NVPTS;
  Poly *tl;
  if (argc == 2)
    nv = atoi(argv[1]);
  nu = read_curve();

  tl = rotsurf(nu, g, nv);
  trilist_write(tl, stdout);
  exit(0);
}


Input-Output

Input
1 1 0
1 -1 0
Output
trilist {
{{-1, -1, 0},  {1, -1, 0},  {1, 1, 0}},
{{-1, 1, 0},  {-1, -1, 0},  {1, 1, 0}},
{{1, -1, 0},  {-1, -1, 0},  {-1, 1, 0}},
{{1, 1, 0},  {1, -1, 0},  {-1, 1, 0}}
}


Extension Options


Copyright © 1998 Luiz Velho