[comp.graphics] Teapot generation program

es2a+@andrew.cmu.edu (Eric Stuyvesant) (11/25/88)

Hi, all...

I am looking for the source code that generated the teapot.nff file
available for anonymous ftp at 128.223.4.1 (drizzle).  Anyone out there
know where I could find this source?

Thanks in advance...

-Eric Stuyvesant
es2a@andrew.cmu.edu

markv@uoregon.uoregon.edu (Mark VandeWettering) (11/27/88)

In article <oXXEi2B68k-0IN-UNl@andrew.cmu.edu> es2a+@andrew.cmu.edu (Eric Stuyvesant) writes:
>Hi, all...
>
>I am looking for the source code that generated the teapot.nff file
>available for anonymous ftp at 128.223.4.1 (drizzle).  Anyone out there
>know where I could find this source?

	Gosh, um, well, the bottom line, there is no source for that.  
	I converted it from a patch list which I got from cs.utah.edu,
	but which I seem to have deleted, and is not available from them
	any more :-(  *sigh*

	I was considering writing such a program, but haven't as of yet.

	Anyone else have something like this?
>-Eric Stuyvesant
>es2a@andrew.cmu.edu

Mark VandeWettering

mah@hpuviea.UUCP (Michael Haberler) (11/28/88)

From article <3243@uoregon.uoregon.edu>, by markv@uoregon.uoregon.edu (Mark VandeWettering):
> In article <oXXEi2B68k-0IN-UNl@andrew.cmu.edu> es2a+@andrew.cmu.edu (Eric Stuyvesant) writes:
>>Hi, all...
>>
>>I am looking for the source code that generated the teapot.nff file
> 
> 	Anyone else have something like this?

There was a teapot patch generation program published in IEEE Computer
Graphics a while ago - maybe a year or two. It had some tables to start with,
and could generate an arbitrary fine teapot. I typed it in (Pascal) and
got it to print PostScript pots. However, it seemed to me that there was some 
bug in the table, because the pot looked odd at one side. I checked the 
tables twice, to no avail. But it's a starting point. I have the source on
my PC at home; if there's need, I'll post it.

michael

-- 
Michael Haberler		mah@hpuviea.at 
Hewlett-Packard Austria GmbH, 	...mcvax!tuvie!hpuviea!mah
Lieblgasse 1 			...hplabs!hpfcla!hpbbn!hpuviea!mah
A-1220 Vienna, Austria		Tel: (0043) (222) 2500 x412 (9-18 CET) 	

mah@hpuviea.UUCP (Michael Haberler) (12/01/88)

A couple of people asked, so here it is. View it as a starting point - it's
Turbo Pascal, and has a bug you will *see* after plotting the pot.


program pot;
const degree = 3;
      duck_count = 306;
      patch_count = 32;

type duck_type = record x,y,z : real;end;
     duck_index_type = 1..duck_count;
     duck_array_type = array[1..duck_count] of duck_type;
     patch_type = array[0..degree,0..degree] of duck_index_type;
     patch_array_type = array[1..patch_count] of patch_type;


var i,steps,lo,hi : integer;
    f  : text;
const ducks : duck_array_type = (
{  1}   (x:    1.4;y:      0;z:    2.4),
{  2}   (x:    1.4;y: -0.784;z:    2.4),
{  3}   (x:  0.784;y:   -1.4;z:    2.4),
{  4}   (x:      0;y:   -1.4;z:    2.4),
{  5}   (x: 1.3375;y:      0;z:2.53125),
{  6}   (x: 1.3375;y: -0.749;z:2.53125),
{  7}   (x:  0.749;y:-1.3375;z:2.53125),
{  8}   (x:      0;y:-1.3375;z:2.53125),
{  9}   (x: 1.4375;y:      0;z:2.53125),
{ 10}   (x: 1.4375;y: -0.805;z:2.53125),
{ 11}   (x:  0.805;y:-1.4375;z:2.53125),
{ 12}   (x:      0;y:-1.4375;z:2.53125),
{ 13}   (x:    1.5;y:      0;z:    2.4),
{ 14}   (x:    1.5;y:  -0.84;z:    2.4),
{ 15}   (x:   0.84;y:   -1.5;z:    2.4),
{ 16}   (x:      0;y:   -1.5;z:    2.4),
{ 17}   (x: -0.784;y:   -1.4;z:    2.4),
{ 18}   (x:   -1.4;y: -0.784;z:    2.4),
{ 19}   (x:   -1.4;y:      0;z:    2.4),
{ 20}   (x: -0.749;y:-1.3375;z:2.53125),
{ 21}   (x:-1.3375;y: -0.749;z:2.53125),
{ 22}   (x:-1.3375;y:      0;z:2.53125),
{ 23}   (x: -0.805;y:-1.4375;z:2.53125),
{ 24}   (x:-1.4375;y: -0.805;z:2.53125),
{ 25}   (x:-1.4375;y:      0;z:2.53125),
{ 26}   (x:  -0.84;y:   -1.5;z:    2.4),
{ 27}   (x:   -1.5;y:  -0.84;z:    2.4),
{ 28}   (x:   -1.5;y:      0;z:    2.4),
{ 29}   (x:   -1.4;y:  0.784;z:    2.4),
{ 30}   (x: -0.784;y:    1.4;z:    2.4),
{ 31}   (x:      0;y:    1.4;z:    2.4),
{ 32}   (x:-1.3375;y:  0.749;z:2.53125),
{ 33}   (x: -0.749;y: 1.3375;z:2.53125),
{ 34}   (x:      0;y: 1.3375;z:2.53125),
{ 35}   (x:-1.4375;y:  0.805;z:2.53125),
{ 36}   (x: -0.805;y: 1.4375;z:2.53125),
{ 37}   (x:      0;y: 1.4375;z:2.53125),
{ 38}   (x:   -1.5;y:   0.84;z:    2.4),
{ 39}   (x:  -0.84;y:    1.5;z:    2.4),
{ 40}   (x:      0;y:    1.5;z:    2.4),
{ 41}   (x:  0.784;y:    1.4;z:    2.4),
{ 42}   (x:    1.4;y:  0.784;z:    2.4),
{ 43}   (x:  0.749;y: 1.3375;z:2.53125),
{ 44}   (x: 1.3375;y:  0.749;z:2.53125),
{ 45}   (x:  0.805;y: 1.4375;z:2.53125),
{ 46}   (x: 1.4375;y:  0.805;z:2.53125),
{ 47}   (x:   0.84;y:    1.5;z:    2.4),
{ 48}   (x:    1.5;y:   0.84;z:    2.4),
{ 49}   (x:   1.75;y:      0;z:  1.875),
{ 50}   (x:   1.75;y:  -0.98;z:  1.875),
{ 51}   (x:   0.98;y:  -1.75;z:  1.875),
{ 52}   (x:      0;y:  -1.75;z:  1.875),
{ 53}   (x:      2;y:      0;z:   1.35),
{ 54}   (x:      2;y:  -1.12;z:   1.35),
{ 55}   (x:   1.12;y:     -2;z:   1.35),
{ 56}   (x:      0;y:     -2;z:   1.35),
{ 57}   (x:      2;y:      0;z:    0.9),
{ 58}   (x:      2;y:  -1.12;z:    0.9),
{ 59}   (x:   1.12;y:     -2;z:    0.9),
{ 60}   (x:      0;y:     -2;z:    0.9),
{ 61}   (x:  -0.98;y:  -1.75;z:  1.875),
{ 62}   (x:  -1.75;y:  -0.98;z:  1.875),
{ 63}   (x:  -1.75;y:      0;z:  1.875),
{ 64}   (x:  -1.12;y:     -2;z:   1.35),
{ 65}   (x:     -2;y:  -1.12;z:   1.35),
{ 66}   (x:     -2;y:      0;z:   1.35),
{ 67}   (x:  -1.12;y:     -2;z:    0.9),
{ 68}   (x:     -2;y:  -1.12;z:    0.9),
{ 69}   (x:     -2;y:      0;z:    0.9),
{ 70}   (x:  -1.75;y:   0.98;z:  1.875),
{ 71}   (x:  -0.98;y:   1.75;z:  1.875),
{ 72}   (x:      0;y:   1.75;z:  1.875),
{ 73}   (x:     -2;y:   1.12;z:   1.35),
{ 74}   (x:  -1.12;y:      2;z:   1.35),
{ 75}   (x:      0;y:      2;z:   1.35),
{ 76}   (x:     -2;y:   1.12;z:    0.9),
{ 77}   (x:  -1.12;y:      2;z:    0.9),
{ 78}   (x:      0;y:      2;z:    0.9),
{ 79}   (x:   0.98;y:   1.75;z:  1.875),
{ 80}   (x:   1.75;y:   0.98;z:  1.875),
{ 81}   (x:   1.12;y:      2;z:   1.35),
{ 82}   (x:      2;y:   1.12;z:   1.35),
{ 83}   (x:   1.12;y:      2;z:    0.9),
{ 84}   (x:      2;y:   1.12;z:    0.9),
{ 85}   (x:      2;y:      0;z:   0.45),
{ 86}   (x:      2;y:  -1.12;z:   0.45),
{ 87}   (x:   1.12;y:     -2;z:   0.45),
{ 88}   (x:      0;y:     -2;z:   0.45),
{ 89}   (x:    1.5;y:      0;z:  0.225),
{ 90}   (x:    1.5;y:  -0.84;z:  0.225),
{ 91}   (x:   0.84;y:   -1.5;z:  0.225),
{ 92}   (x:      0;y:   -1.5;z:  0.225),
{ 93}   (x:    1.5;y:      0;z:   0.15),
{ 94}   (x:    1.5;y:  -0.84;z:   0.15),
{ 95}   (x:   0.84;y:   -1.5;z:   0.15),
{ 96}   (x:      0;y:   -1.5;z:   0.15),
{ 97}   (x:  -1.12;y:     -2;z:   0.45),
{ 98}   (x:     -2;y:  -1.12;z:   0.45),
{ 99}   (x:     -2;y:      0;z:   0.45),
{100}   (x:  -0.84;y:   -1.5;z:  0.225),
{101}   (x:   -1.5;y:  -0.84;z:  0.225),
{102}   (x:   -1.5;y:      0;z:  0.225),
{103}   (x:  -0.84;y:   -1.5;z:   0.15),
{104}   (x:   -1.5;y:  -0.84;z:   0.15),
{105}   (x:   -1.5;y:      0;z:   0.15),
{106}   (x:     -2;y:   1.12;z:   0.45),
{107}   (x:  -1.12;y:      2;z:   0.45),
{108}   (x:      0;y:      2;z:   0.45),
{109}   (x:   -1.5;y:   0.84;z:  0.225),
{110}   (x:  -0.84;y:    1.5;z:  0.225),
{111}   (x:      0;y:    1.5;z:  0.225),
{112}   (x:   -1.5;y:   0.84;z:   0.15),
{113}   (x:  -0.84;y:    1.5;z:   0.15),
{114}   (x:      0;y:    1.5;z:   0.15),
{115}   (x:   1.12;y:      2;z:   0.45),
{116}   (x:      2;y:   1.12;z:   0.45),
{117}   (x:   0.84;y:    1.5;z:  0.225),
{118}   (x:    1.5;y:   0.84;z:  0.225),
{119}   (x:   0.84;y:    1.5;z:   0.15),
{120}   (x:    1.5;y:   0.84;z:   0.15),
{121}   (x:   -1.6;y:      0;z:  2.025),
{122}   (x:   -1.6;y:   -0.3;z:  2.025),
{123}   (x:   -1.5;y:   -0.3;z:   2.25),
{124}   (x:   -1.5;y:      0;z:   2.25),
{125}   (x:   -2.3;y:      0;z:  2.025),
{126}   (x:   -2.3;y:   -0.3;z:  2.025),
{127}   (x:   -2.5;y:   -0.3;z:   2.25),
{128}   (x:   -2.5;y:      0;z:   2.25),
{129}   (x:   -2.7;y:      0;z:  2.025),
{130}   (x:   -2.7;y:   -0.3;z:  2.025),
{131}   (x:     -3;y:   -0.3;z:   2.25),
{132}   (x:     -3;y:      0;z:   2.25),
{133}   (x:   -2.7;y:      0;z:    1.8),
{134}   (x:   -2.7;y:   -0.3;z:    1.8),
{135}   (x:     -3;y:   -0.3;z:    1.8),
{136}   (x:     -3;y:      0;z:    1.8),
{137}   (x:   -1.5;y:    0.3;z:   2.25),
{138}   (x:   -1.6;y:    0.3;z:  2.025),
{139}   (x:   -2.5;y:    0.3;z:   2.25),
{140}   (x:   -2.3;y:    0.3;z:  2.025),
{141}   (x:     -3;y:    0.3;z:   2.25),
{142}   (x:   -2.7;y:    0.3;z:  2.025),
{143}   (x:     -3;y:    0.3;z:    1.8),
{144}   (x:   -2.7;y:    0.3;z:    1.8),
{145}   (x:   -2.7;y:      0;z:  1.575),
{146}   (x:   -2.7;y:   -0.3;z:  1.575),
{147}   (x:     -3;y:   -0.3;z:   1.35),
{148}   (x:     -3;y:      0;z:   1.35),
{149}   (x:   -2.5;y:      0;z:  1.125),
{150}   (x:   -2.5;y:   -0.3;z:  1.125),
{151}   (x:  -2.65;y:   -0.3;z: 0.9375),
{152}   (x:  -2.65;y:      0;z: 0.9375),
{153}   (x:     -2;y:   -0.3;z:    0.9),
{154}   (x:   -1.9;y:   -0.3;z:    0.6),
{155}   (x:   -1.9;y:      0;z:    0.6),
{156}   (x:     -3;y:    0.3;z:   1.35),
{157}   (x:   -2.7;y:    0.3;z:  1.575),
{158}   (x:  -2.65;y:    0.3;z: 0.9375),
{159}   (x:   -2.5;y:    0.3;z:  1.125),
{160}   (x:   -1.9;y:    0.3;z:    0.6),
{161}   (x:     -2;y:    0.3;z:    0.9),
{162}   (x:    1.7;y:      0;z:  1.425),
{163}   (x:    1.7;y:  -0.66;z:  1.425),
{164}   (x:    1.7;y:  -0.66;z:    0.6),
{165}   (x:    1.7;y:      0;z:    0.6),
{166}   (x:    2.6;y:      0;z:  1.425),
{167}   (x:    2.6;y:  -0.66;z:  1.425),
{168}   (x:    3.1;y:  -0.66;z:  0.825),
{169}   (x:    3.1;y:      0;z:  0.825),
{170}   (x:    2.3;y:      0;z:    2.1),
{171}   (x:    2.3;y:  -0.25;z:    2.1),
{172}   (x:    2.4;y:  -0.25;z:  2.025),
{173}   (x:    2.4;y:      0;z:  2.025),
{174}   (x:    2.7;y:      0;z:    2.4),
{175}   (x:    2.7;y:  -0.25;z:    2.4),
{176}   (x:    3.3;y:  -0.25;z:    2.4),
{177}   (x:    3.3;y:      0;z:    2.4),
{178}   (x:    1.7;y:   0.66;z:    0.6),
{179}   (x:    1.7;y:   0.66;z:  1.425),
{180}   (x:    3.1;y:   0.66;z:  0.825),
{181}   (x:    2.6;y:   0.66;z:  1.425),
{182}   (x:    2.4;y:   0.25;z:  2.025),
{183}   (x:    2.3;y:   0.25;z:    2.1),
{184}   (x:    3.3;y:   0.25;z:    2.4),
{185}   (x:    2.7;y:   0.25;z:    2.4),
{186}   (x:    2.8;y:      0;z:  2.475),
{187}   (x:    2.8;y:  -0.25;z:  2.475),
{188}   (x:  3.525;y:  -0.25;z:2.49375),
{189}   (x:  3.525;y:      0;z:2.49375),
{190}   (x:    2.9;y:      0;z:  2.475),
{191}   (x:    2.9;y:  -0.15;z:  2.475),
{192}   (x:   3.45;y:  -0.15;z: 2.5125),
{193}   (x:   3.45;y:      0;z: 2.5125),
{194}   (x:    2.8;y:      0;z:    2.4),
{195}   (x:    2.8;y:  -0.15;z:    2.4),
{196}   (x:    3.2;y:  -0.15;z:    2.4),
{197}   (x:    3.2;y:      0;z:    2.4),
{198}   (x:  3.525;y:   0.25;z:2.49375),
{199}   (x:    2.8;y:   0.25;z:  2.475),
{200}   (x:   3.45;y:   0.15;z: 2.5125),
{201}   (x:    2.9;y:   0.15;z:  2.475),
{202}   (x:    3.2;y:   0.15;z:    2.4),
{203}   (x:    2.8;y:   0.15;z:    2.4),
{204}   (x:      0;y:      0;z:   3.15),
{205}   (x:      0;y: -0.002;z:   3.15),
{206}   (x:  0.002;y:      0;z:   3.15),
{207}   (x:    0.8;y:      0;z:   3.15),
{208}   (x:    0.8;y:  -0.45;z:   3.15),
{209}   (x:   0.45;y:   -0.8;z:   3.15),
{210}   (x:      0;y:   -0.8;z:   3.15),
{211}   (x:      0;y:      0;z:   2.85),
{212}   (x:    0.2;y:      0;z:    2.7),
{213}   (x:    0.2;y: -0.112;z:    2.7),
{214}   (x:  0.112;y:   -0.2;z:    2.7),
{215}   (x:      0;y:   -0.2;z:    2.7),
{216}   (x: -0.002;y:      0;z:   3.15),
{217}   (x:  -0.45;y:   -0.8;z:   3.15),
{218}   (x:   -0.8;y:  -0.45;z:   3.15),
{219}   (x:   -0.8;y:      0;z:   3.15),
{220}   (x: -0.112;y:   -0.2;z:    2.7),
{221}   (x:   -0.2;y: -0.112;z:    2.7),
{222}   (x:   -0.2;y:      0;z:    2.7),
{223}   (x:      0;y:  0.002;z:   3.15),
{224}   (x:   -0.8;y:   0.45;z:   3.15),
{225}   (x:  -0.45;y:    0.8;z:   3.15),
{226}   (x:      0;y:    0.8;z:   3.15),
{227}   (x:   -0.2;y:  0.112;z:    2.7),
{228}   (x: -0.112;y:    0.2;z:    2.7),
{229}   (x:      0;y:    0.2;z:    2.7),
{230}   (x:   0.45;y:    0.8;z:   3.15),
{231}   (x:    0.8;y:   0.45;z:   3.15),
{232}   (x:  0.112;y:    0.2;z:    2.7),
{233}   (x:    0.2;y:  0.112;z:    2.7),
{234}   (x:    0.4;y:      0;z:   2.55),
{235}   (x:    0.4;y: -0.224;z:   2.55),
{236}   (x:  0.224;y:   -0.4;z:   2.55),
{237}   (x:      0;y:   -0.4;z:   2.55),
{238}   (x:    1.3;y:      0;z:   2.55),
{239}   (x:    1.3;y: -0.728;z:   2.55),
{240}   (x:  0.728;y:   -1.3;z:   2.55),
{241}   (x:      0;y:   -1.3;z:   2.55),
{242}   (x:    1.3;y:      0;z:    2.4),
{243}   (x:    1.3;y: -0.728;z:    2.4),
{244}   (x:  0.728;y:   -1.3;z:    2.4),
{245}   (x:      0;y:   -1.3;z:    2.4),
{246}   (x: -0.224;y:   -0.4;z:   2.55),
{247}   (x:   -0.4;y: -0.224;z:   2.55),
{248}   (x:   -0.4;y:      0;z:   2.55),
{249}   (x: -0.728;y:   -1.3;z:   2.55),
{250}   (x:   -1.3;y: -0.728;z:   2.55),
{251}   (x:   -1.3;y:      0;z:   2.55),
{252}   (x: -0.728;y:   -1.3;z:    2.4),
{253}   (x:   -1.3;y: -0.728;z:    2.4),
{254}   (x:   -1.3;y:      0;z:    2.4),
{255}   (x:   -0.4;y:  0.224;z:   2.55),
{256}   (x: -0.224;y:    0.4;z:   2.55),
{257}   (x:      0;y:    0.4;z:   2.55),
{258}   (x:   -1.3;y:  0.728;z:   2.55),
{259}   (x: -0.728;y:    1.3;z:   2.55),
{260}   (x:      0;y:    1.3;z:   2.55),
{261}   (x:   -1.3;y:  0.728;z:    2.4),
{262}   (x: -0.728;y:    1.3;z:    2.4),
{263}   (x:      0;y:    1.3;z:    2.4),
{264}   (x:  0.224;y:    0.4;z:   2.55),
{265}   (x:    0.4;y:  0.224;z:   2.55),
{266}   (x:  0.728;y:    1.3;z:   2.55),
{267}   (x:    1.3;y:  0.728;z:   2.55),
{268}   (x:  0.728;y:    1.3;z:    2.4),
{269}   (x:    1.3;y:  0.728;z:    2.4),
{270}   (x:      0;y:      0;z:      0),
{271}   (x:    1.5;y:      0;z:   0.15),
{272}   (x:    1.5;y:   0.84;z:   0.15),
{273}   (x:   0.84;y:    1.5;z:   0.15),
{274}   (x:      0;y:    1.5;z:   0.15),
{275}   (x:    1.5;y:      0;z:  0.075),
{276}   (x:    1.5;y:   0.84;z:  0.075),
{277}   (x:   0.84;y:    1.5;z:  0.075),
{278}   (x:      0;y:    1.5;z:  0.075),
{279}   (x:  1.425;y:      0;z:      0),
{280}   (x:  1.425;y:  0.798;z:      0),
{281}   (x:  0.798;y:  1.425;z:      0),
{282}   (x:      0;y:  1.425;z:      0),
{283}   (x:  -0.84;y:    1.5;z:   0.15),
{284}   (x:   -1.5;y:   0.84;z:   0.15),
{285}   (x:   -1.5;y:      0;z:   0.15),
{286}   (x:  -0.84;y:    1.5;z:  0.075),
{287}   (x:   -1.5;y:   0.84;z:  0.075),
{288}   (x:   -1.5;y:      0;z:  0.075),
{289}   (x: -0.798;y:  1.425;z:      0),
{290}   (x: -1.425;y:  0.798;z:      0),
{291}   (x: -1.425;y:      0;z:      0),
{292}   (x:   -1.5;y:  -0.84;z:   0.15),
{293}   (x:  -0.84;y:   -1.5;z:   0.15),
{294}   (x:      0;y:   -1.5;z:   0.15),
{295}   (x:   -1.5;y:  -0.84;z:  0.075),
{296}   (x:  -0.84;y:   -1.5;z:  0.075),
{297}   (x:      0;y:   -1.5;z:  0.075),
{298}   (x: -1.425;y: -0.798;z:      0),
{299}   (x: -0.798;y: -1.425;z:      0),
{300}   (x:      0;y: -1.425;z:      0),
{301}   (x:  -0.84;y:   -1.5;z:   0.15),
{302}   (x:    1.5;y:  -0.84;z:   0.15),
{303}   (x:   0.84;y:   -1.5;z:  0.075),
{304}   (x:    1.5;y:  -0.84;z:  0.075),
{305}   (x:  0.798;y: -1.425;z:      0),
{306}   (x:  1.425;y: -0.798;z:      0));
      patches : patch_array_type = (
{ 1}  ((  1,  2,  3,  4),(  5,  6,  7,  8),(  9, 10, 11, 12),( 13, 14, 15, 16)),
{ 2}  ((  4, 17, 18, 19),(  8, 20, 21, 22),( 12, 23, 24, 25),( 16, 26, 27, 28)),
{ 3}  (( 19, 29, 30, 31),( 22, 32, 33, 34),( 25, 35, 36, 37),( 28, 38, 39, 40)),
{ 4}  (( 31, 41, 42,  1),( 34, 43, 44,  5),( 37, 45, 46,  9),( 40, 47, 48, 13)),
{  5} (( 13, 14, 15, 16),( 49, 50, 51, 52),( 53, 54, 55, 56),( 57, 58, 59, 60)),
{  6} (( 16, 26, 27, 28),( 52, 61, 62, 63),( 56, 64, 65, 66),( 60, 67, 78, 69)),
{  7} (( 28, 38, 39, 40),( 63, 70, 71, 72),( 66, 73, 74, 75),( 69, 76, 77, 78)),
{  8} (( 40, 47, 48, 13),( 72, 79, 80, 49),( 75, 81, 82, 53),( 78, 83, 84, 57)),
{  9} (( 57, 58, 59, 60),( 85, 86, 87, 88),( 89, 90, 91, 92),( 93, 94, 95, 96)),
{ 10} (( 60, 67, 68, 69),( 88, 97, 98, 99),( 92,100,101,102),( 96,103,104,105)),
{ 11} (( 69, 76, 77, 78),( 99,106,107,108),(102,109,110,111),(105,112,113,114)),
{ 12} (( 78, 83, 84, 57),(108,115,116, 85),(111,117,118, 89),(114,119,120, 93)),
{ 13} ((121,122,123,124),(125,126,127,128),(129,130,131,132),(133,134,135,136)),
{ 14} ((124,137,138,121),(128,139,140,125),(132,141,142,129),(136,143,144,133)),
{ 15} ((133,134,135,136),(145,146,147,148),(149,150,151,152),( 69,153,154,155)),
{ 16} ((136,143,144,133),(148,156,157,145),(152,158,159,149),(155,160,161, 69)),
{ 17} ((162,163,164,165),(166,167,168,169),(170,171,172,173),(174,175,176,177)),
{ 18} ((165,178,179,162),(169,180,181,166),(173,182,183,170),(177,184,185,174)),
{ 19} ((174,175,176,177),(186,187,188,189),(190,191,192,193),(194,195,196,197)),
{ 20} ((177,184,185,174),(189,198,199,186),(193,200,201,190),(197,202,203,194)),
{ 21} ((204,204,204,204),(207,208,209,210),(211,211,211,211),(212,213,214,215)),
{ 22} ((204,204,204,204),(210,217,218,219),(211,211,211,211),(215,220,221,222)),
{ 23} ((204,204,204,204),(219,224,225,226),(211,211,211,211),(222,227,228,229)),
{ 24} ((204,204,204,204),(226,230,231,207),(211,211,211,211),(229,232,233,212)),
{ 25} ((212,213,214,215),(234,235,236,237),(238,239,240,241),(242,243,244,245)),
{ 26} ((215,220,221,222),(237,246,247,248),(241,249,250,251),(245,252,253,254)),
{ 27} ((222,227,228,229),(248,255,256,257),(251,258,259,260),(254,261,262,263)),
{ 28} ((229,232,233,212),(257,264,265,234),(260,266,267,238),(263,268,269,242)),
{ 29} ((270,270,270,270),(279,280,281,282),(275,276,277,278),(271,272,273,274)),
{ 30} ((270,270,270,270),(282,289,290,291),(278,286,287,288),(274,283,284,285)),
{ 31} ((270,270,270,270),(291,298,299,300),(288,295,296,297),(285,292,293,294)),
{ 32} ((270,270,270,270),(300,305,306,279),(297,303,304,275),(294,301,302,271))
);

procedure blend_vector(d0,d1,d2,d3 : duck_type; t : real; var result:duck_type);
begin { blend_vector }
  result.x := d0.x*(1-t)*(1-t)*(1-t) + d1.x*3*t*(1-t)*(1-t) +
              d2.x*3*t*t*(1-t)       + d3.x*t*t*t;

  result.y := d0.y*(1-t)*(1-t)*(1-t) + d1.y*3*t*(1-t)*(1-t) +
              d2.y*3*t*t*(1-t)       + d3.y*t*t*t;

  result.z := d0.z*(1-t)*(1-t)*(1-t) + d1.z*3*t*(1-t)*(1-t) +
              d2.z*3*t*t*(1-t)       + d3.z*t*t*t;
end; { blend_vector }

procedure display_curve(d0,d1,d2,d3: duck_type; steps: integer);
  var
    t,step:real;
    temp:duck_type;

begin { display_curve }
  step := 1/steps; t:= step;
  writeln(f,'move ',d0.x,d0.y,d0.z);
  while t < 1 + step/2 do begin
    blend_vector(d0,d1,d2,d3,t,temp);
    writeln(f,'cont ',temp.x,temp.y,temp.z);
    t := t + step;
  end; {endwhile}
end; { display_curve }

procedure display_patch(var patch:patch_type; steps:integer);
  var t,step:real;
      d0,d1,d2,d3 : duck_type;

begin { display_patch }
  step := 1/steps;
  t := 0;
  while t < 1 + step/2 do begin
    blend_vector(ducks[patch[0,0]],ducks[patch[0,1]], ducks[patch[0,2]], ducks[patch[0,3]],T,d0);
    blend_vector(ducks[patch[1,0]],ducks[patch[1,1]], ducks[patch[1,2]], ducks[patch[1,3]],T,d1);
    blend_vector(ducks[patch[2,0]],ducks[patch[2,1]], ducks[patch[2,2]], ducks[patch[2,3]],T,d2);
    blend_vector(ducks[patch[3,0]],ducks[patch[3,1]], ducks[patch[3,2]], ducks[patch[3,3]],T,d3);
    display_curve(d0,d1,d2,d3,steps);

    blend_vector(ducks[patch[0,0]],ducks[patch[1,0]], ducks[patch[2,0]], ducks[patch[3,0]],T,d0);
    blend_vector(ducks[patch[0,1]],ducks[patch[1,1]], ducks[patch[2,1]], ducks[patch[3,1]],T,d1);
    blend_vector(ducks[patch[0,2]],ducks[patch[1,2]], ducks[patch[2,2]], ducks[patch[3,2]],T,d2);
    blend_vector(ducks[patch[0,3]],ducks[patch[1,3]], ducks[patch[2,3]], ducks[patch[3,3]],T,d3);
    display_curve(d0,d1,d2,d3,steps);
    t := t + step;
  end; {endwhile}
end; { display_patch }

begin
  assign(f,'pot.dat');rewrite(f);
  {
  writeln('low,high,steps?');readln(lo,hi,steps);
  }
  steps := 4;

  for i := {lo to hi }1 to Patch_Count do begin
    display_patch(patches[i],steps);
  end; {endfor}
  close(f);
end.

-- 
Michael Haberler		mah@hpuviea.at 
Hewlett-Packard Austria GmbH, 	...mcvax!tuvie!hpuviea!mah
Lieblgasse 1 			...hplabs!hpfcla!hpbbn!hpuviea!mah
A-1220 Vienna, Austria		Tel: (0043) (222) 2500 x412 (9-18 CET)