[comp.graphics] teapot database

peter@sugar.UUCP (Peter da Silva) (10/22/87)

Does anyone have a copy of the teapot node/vertex database that was recently
published in Computer Graphics World? I could type it all in, but I'd much
rather download it...
-- 
-- Peter da Silva  `-_-'  ...!hoptoad!academ!uhnix1!sugar!peter
-- Disclaimer: These U aren't mere opinions... these are *values*.

arenberg@trwrb.UUCP (Jeff Arenberg) (08/23/88)

I am currently working on a ray-tracing program on a Mac II and I've
decided its time to test it on a really big scene.  I would like to
benchmark my code against other published results, so I need some object
that has been used a lot.  The teapot seems to be the most common
multi-polygon object in the literature, at least that I've seen, so I was
hoping someone out there has a copy of the polygon database that I could
obtain or direct me to a source for it.  

Thanks much in advance,

Jeff Arenberg
-------------------------------------------------------------
UUCP : < ucbvax, ihnp4, uscvax > !trwrb!csed-pyramid!arenberg
-------------------------------------------------------------

toad@nl.cs.cmu.edu (Todd Kaufmann) (08/23/88)

Here it is, as was posted to net.graphics a little over two years ago...
thought it was time for a repost.  It's been sitting in my archives since
then, and I never used it.  Hope there's no bit rot.

Note that it is NOT in polygon form, but rather bezier patches.. you could
calculate the patches yourself, and break it up into as many polygons as you
like.

Enjoy,
	todd
--------------------------------------------
From: jon@cit-vax
Newsgroups: net.graphics
Subject: Re: want historical object data (teapots and klein bottles)
Date: Sat, 10-May-86 06:39:36 EDT
Organization: California Institute of Technology
Lines: 254
Summary: Here's the teapot
Keywords: 3D models, neato, keen

In article <2032@teklds.UUCP> jimb@teklds.UUCP (Timothy F. O'Connor) writes:
>
>	I would very much like to get my hands on some of the historical
>	3D models that appear from time to time (mostly in odd places).
>	These are things like the champagne glass from Phong's thesis,
>	Clark's Klein bottle, and the ever infamous teapot (is it
>	Catmull's or Newell's?	I don't know).	I've got an image in mind
>	...

    The teapot database is included as a 'shar' file  at  the  end  of
this article. The comments should explain what in here. This  database
is quite probably the original	as  Jim  Blinn	supplied  it  for  the
Computer Graphics class I'm TAing (and he's teaching). The database is
NOT in polygonal form. Basically the commands in these	files  are  as
follows:

    PNT N, X, Y, Z   - define point #N with coordinates (X,Y,Z)
    BEZC N1,N2,N3,N4 - draw bezier curve with control points N1..N4
    BEZS N1,..N16    - draw bezier surface with control points N1..N16
			(in a grid: N1	N2  N3	N4
				    N5	 ...	N8
				    ..		..
				    N13  ...	N16

    These are intended for a  left-handed  coordinate  system  with  Z
increasing into the screen (not that it  really  matters).   You  will
also have to write a program to compute a surface of  revolution  from
a bezier curve for the lid and body profiles. If you  don't  know  how
to compute bicubic patches, you should	-  try	Newman	&  Sproull  or
Foley & Van Dam. There is a paper by Caltech professor Jim  Kajiya  on
ray tracing bicubic patches in	SIGGRAPH  Proceedings  a  few  summers
back, and more	recent	articles  on  tracing  parametric  patches  in
general in the last few SIGGRAPHs. Or just chop it  up	into  lots  of
polygons (``Polygons, Keptin! Millions of them!'').

    I also have the Sutherland VW database (in	polygonal  form).   If
there's sufficient interest  I'll  post  it  to  the  net.  I  do  not
particularly want to send individual  copies  because  of  the	effort
involved.

    -- Jon
    __@/

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	TPOTBC.TEXT
#	TPOTHH.TEXT
#	TPOTLC.TEXT
#	TPOTLQ.TEXT
#	TPOTSH.TEXT
# This archive created: Sat May 10 03:26:18 1986
export PATH; PATH=/bin:$PATH
if test -f 'TPOTBC.TEXT'
then
	echo shar: will not over-write existing file "'TPOTBC.TEXT'"
else
cat << \SHAR_EOF > 'TPOTBC.TEXT'
       OUTLINE CURVE OF BODY OF TEAPOT
       SWEEP AROUND Y AXIS FOR WHOLE BODY

PNT  1,  1.40000, 2.25000, 0.00000,,,,
PNT  2,  1.33750, 2.38125, 0.00000,
PNT  3,  1.43750, 2.38125, 0.00000,
PNT  4,  1.50000, 2.25000, 0.00000,

BEZC  1,2,3,4

PNT  5,  1.75000, 1.72500, 0.00000,
PNT  6,  2.00000, 1.20000, 0.00000,
PNT  7,  2.00000, 0.75000, 0.00000,

BEZC 4,5,6,7

PNT  8,  2.00000, 0.30000, 0.00000,
PNT  9,  1.50000, 0.07500, 0.00000,
PNT 10,  1.50000, 0.00000, 0.00000,

BEZC 7,8,9,10
SHAR_EOF
fi # end of overwriting check
if test -f 'TPOTHH.TEXT'
then
	echo shar: will not over-write existing file "'TPOTHH.TEXT'"
else
cat << \SHAR_EOF > 'TPOTHH.TEXT'
	1/2 HANDLE OF TEAPOT
	MIRROR ABOUT Z FOR OTHER HALF

PNT   1, -1.60000, 1.87500, 0.00000,,,,
PNT   2, -1.60000, 1.87500, 0.30000,
PNT   3, -1.50000, 2.10000, 0.30000,
PNT   4, -1.50000, 2.10000, 0.00000,

PNT   5, -2.30000, 1.87500, 0.00000,
PNT   6, -2.30000, 1.87500, 0.30000,
PNT   7, -2.50000, 2.10000, 0.30000,
PNT   8, -2.50000, 2.10000, 0.00000,

PNT   9, -2.70000, 1.87500, 0.00000,
PNT  10, -2.70000, 1.87500, 0.30000,
PNT  11, -3.00000, 2.10000, 0.30000,
PNT  12, -3.00000, 2.10000, 0.00000,

PNT  13, -2.70000, 1.65000, 0.00000,
PNT  14, -2.70000, 1.65000, 0.30000,
PNT  15, -3.00000, 1.65000, 0.30000,
PNT  16, -3.00000, 1.65000, 0.00000,

BEZS 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16

PNT  17, -2.70000, 1.42500, 0.00000,
PNT  18, -2.70000, 1.42500, 0.30000,
PNT  19, -3.00000, 1.20000, 0.30000,
PNT  20, -3.00000, 1.20000, 0.00000,
PNT  21, -2.50000, 0.97500, 0.00000,
PNT  22, -2.50000, 0.97500, 0.30000,
PNT  23, -2.65000, 0.78750, 0.30000,
PNT  24, -2.65000, 0.78750, 0.00000,

PNT  25, -2.00000, 0.75000, 0.00000,
PNT  26, -2.00000, 0.75000, 0.30000,
PNT  27, -1.90000, 0.45000, 0.30000,
PNT  28, -1.90000, 0.45000, 0.00000,

BEZS 13,14,15,16, 17,18,19,20, 21,22,23,24, 25,26,27,28
SHAR_EOF
fi # end of overwriting check
if test -f 'TPOTLC.TEXT'
then
	echo shar: will not over-write existing file "'TPOTLC.TEXT'"
else
cat << \SHAR_EOF > 'TPOTLC.TEXT'
	CONTOUR OF TEAPOT LID (IN XY PLANE)
	SWEEP AROUND Y AXIS FOR WHOLE LID

PNT  1,  0.00000, 3.00000, 0.00000,,,,
PNT  2,  0.80000, 3.00000, 0.00000,
PNT  3,  0.00000, 2.70000, 0.00000,
PNT  4,  0.20000, 2.55000, 0.00000,

PNT  5,  0.40000, 2.40000, 0.00000,
PNT  6,  1.30000, 2.40000, 0.00000,
PNT  7,  1.30000, 2.25000, 0.00000,

BEZC  1,2,3,4
BEZC  4,5,6,7
SHAR_EOF
fi # end of overwriting check
if test -f 'TPOTLQ.TEXT'
then
	echo shar: will not over-write existing file "'TPOTLQ.TEXT'"
else
cat << \SHAR_EOF > 'TPOTLQ.TEXT'
PNT   1,  0.00000, 3.00000, 0.00000,,,,
PNT   2,  0.00000, 3.00000, 0.00200,
PNT   3,  0.00200, 3.00000, 0.00000,
PNT   4,  0.00000, 3.00000, 0.00000,

PNT   5,  0.80000, 3.00000, 0.00000,
PNT   6,  0.80000, 3.00000, 0.45000,
PNT   7,  0.45000, 3.00000, 0.80000,
PNT   8,  0.00000, 3.00000, 0.80000,

PNT   9,  0.00000, 2.70000, 0.00000,
PNT  10,  0.00000, 2.70000, 0.00000,
PNT  11,  0.00000, 2.70000, 0.00000,
PNT  12,  0.00000, 2.70000, 0.00000,

PNT  13,  0.20000, 2.55000, 0.00000,
PNT  14,  0.20000, 2.55000, 0.11200,
PNT  15,  0.11200, 2.55000, 0.20000,
PNT  16,  0.00000, 2.55000, 0.20000,

BEZS 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16


PNT  17,  0.40000, 2.40000, 0.00000,
PNT  18,  0.40000, 2.40000, 0.22400,
PNT  19,  0.22400, 2.40000, 0.40000,
PNT  20,  0.00000, 2.40000, 0.40000,
PNT  21,  1.30000, 2.40000, 0.00000,
PNT  22,  1.30000, 2.40000, 0.72800,
PNT  23,  0.72800, 2.40000, 1.30000,
PNT  24,  0.00000, 2.40000, 1.30000,

PNT  25,  1.30000, 2.25000, 0.00000,
PNT  26,  1.30000, 2.25000, 0.72800,
PNT  27,  0.72800, 2.25000, 1.30000,
PNT  28,  0.00000, 2.25000, 1.30000,

BEZS 13,14,15,16, 17,18,19,20, 21,22,23,24, 25,26,27,28,
SHAR_EOF
fi # end of overwriting check
if test -f 'TPOTSH.TEXT'
then
	echo shar: will not over-write existing file "'TPOTSH.TEXT'"
else
cat << \SHAR_EOF > 'TPOTSH.TEXT'
	 1/2 SPOUT OF TEAPOT
	 MIRROR ABOUT Z FOR OTHER HALF

PNT   1,  1.70000, 1.27500, 0.00000,,,,
PNT   2,  1.70000, 1.27500, 0.66000,
PNT   3,  1.70000, 0.45000, 0.66000,
PNT   4,  1.70000, 0.45000, 0.00000,

PNT   5,  2.60000, 1.27500, 0.00000,
PNT   6,  2.60000, 1.27500, 0.66000,
PNT   7,  3.10000, 0.67500, 0.66000,
PNT   8,  3.10000, 0.67500, 0.00000,

PNT   9,  2.30000, 1.95000, 0.00000,
PNT  10,  2.30000, 1.95000, 0.25000,
PNT  11,  2.40000, 1.87500, 0.25000,
PNT  12,  2.40000, 1.87500, 0.00000,

PNT  13,  2.70000, 2.25000, 0.00000,
PNT  14,  2.70000, 2.25000, 0.25000,
PNT  15,  3.30000, 2.25000, 0.25000,
PNT  16,  3.30000, 2.25000, 0.00000,

BEZS 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16

PNT  17,  2.80000, 2.32500, 0.00000,
PNT  18,  2.80000, 2.32500, 0.25000,
PNT  19,  3.52500, 2.34375, 0.25000,
PNT  20,  3.52500, 2.34375, 0.00000,

PNT  21,  2.90000, 2.32500, 0.00000,
PNT  22,  2.90000, 2.32500, 0.15000,
PNT  23,  3.45000, 2.36250, 0.15000,
PNT  24,  3.45000, 2.36250, 0.00000,

PNT  25,  2.80000, 2.25000, 0.00000,
PNT  26,  2.80000, 2.25000, 0.15000,
PNT  27,  3.20000, 2.25000, 0.15000,
PNT  28,  3.20000, 2.25000, 0.00000,

BEZS 13,14,15,16, 17,18,19,20, 21,22,23,24, 25,26,27,28
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
uucp    : ...!{seismo, ucbvax, harvard}!nl.cs.cmu.edu!toad
internet: toad@cs.cmu.edu
us snail: Pobox 81795-UN, Pittsburgh PA 15217  (mail-art exchange)
``In Xanadu, to be an individual one must be a clone.''   -future proverb

u-jmolse%sunset.utah.edu@utah-cs.UUCP (John M. Olsen) (08/23/88)

arenberg@csed-pyramid.UUCP (Jeff Arenberg) writes:
>The teapot seems to be the most common
>multi-polygon object in the literature, at least that I've seen, so I was
>hoping someone out there has a copy of the polygon database that I could
>obtain or direct me to a source for it.  
>
>Jeff Arenberg
>-------------------------------------------------------------
>UUCP : < ucbvax, ihnp4, uscvax > !trwrb!csed-pyramid!arenberg
>-------------------------------------------------------------

Well, since it's the *Utah* teapot, Utah might be a good place to look.:^)
The polygon description	of that puppy weighs in at just over 900K.  Are you
Sure you want it?  This may be a very heavy duty verion, but it's the only
one I could see hanging around the file system here.


 /|  |     /|||  /\|       | John M. Olsen, 1547 Jamestown Drive
 \|()|\|\_  |||. \/|/)@|\_ | Salt Lake City, UT  84121-2051     
  |	u-jmolse%ug@cs.utah.edu or ...!utah-cs!utah-ug!u-jmolse
	"...if cows ate plankton whales would die off." Randy Meyers

woody@tybalt.caltech.edu (William Edward Woody) (08/25/88)

Actually, me too.

If some kind soul could get in touch with me (as I don't regularly subscribe
to this newsgroup) and tell me how to get my hands on the teapot database,
as well as pointers to other useful databases, I'd be more than greatful.

Thanks.

(Don't flame me; I don't know where else to go for this info...)

  -  William Edward Woody
     woody@tybalt.caltech.edu                   (Mac>][n&&/|\)&&(MacII>AT)
Disclamer:  I haven't the foggiest idea what I'm talking about...

spencer@tut.cis.ohio-state.edu (Stephen Spencer) (08/25/88)

In article <7684@cit-vax.Caltech.Edu>, woody@tybalt.caltech.edu (William Edward Woody) writes:
> 
> If some kind soul could get in touch with me (as I don't regularly subscribe
> to this newsgroup) and tell me how to get my hands on the teapot database,
> as well as pointers to other useful databases, I'd be more than greatful.
> 

Here is the teapot database along with most of the code needed to traverse the
patch structure of the teapot.  I adapted this program (although on another 
machine, alas) to output polygon information, so there is a way to convert.

A useful graphical database is available from Eric Haines of 3D-Eye in Ithaca
New York.  I believe the database package is available from research@netlib,
an archive server node.

Anyway, here's the teapot data and code.  The original poster's name and 
address is in there somewhere...


-------------------------------------------------------------------

TeaPotWithBot.shape-- Martin Newell's Teapot with a bottom added
Created by: crow.pa at February 28, 1986 11:09:32 am PST

SurfaceType ~ Bezier, Closed, CountFromOne -- 306 vertices, 32 patches

Vertices ~ xyz: triple 
 
   1.4   0.0   2.4
   1.4   -0.784   2.4
   0.784   -1.4   2.4
   0.0   -1.4   2.4
   1.3375   0.0   2.53125
   1.3375   -0.749   2.53125
   0.749   -1.3375   2.53125
   0.0   -1.3375   2.53125
   1.4375   0.0   2.53125
   1.4375   -0.805   2.53125
   0.805   -1.4375   2.53125
   0.0   -1.4375   2.53125
   1.5   0.0   2.4
   1.5   -0.84   2.4
   0.84   -1.5   2.4
   0.0   -1.5   2.4
   -0.784   -1.4   2.4
   -1.4   -0.784   2.4
   -1.4   0.0   2.4
   -0.749   -1.3375   2.53125
   -1.3375   -0.749   2.53125
   -1.3375   0.0   2.53125
   -0.805   -1.4375   2.53125
   -1.4375   -0.805   2.53125
   -1.4375   0.0   2.53125
   -0.84   -1.5   2.4
   -1.5   -0.84   2.4
   -1.5   0.0   2.4
   -1.4   0.784   2.4
   -0.784   1.4   2.4
   0.0   1.4   2.4
   -1.3375   0.749   2.53125
   -0.749   1.3375   2.53125
   0.0   1.3375   2.53125
   -1.4375   0.805   2.53125
   -0.805   1.4375   2.53125
   0.0   1.4375   2.53125
   -1.5   0.84   2.4
   -0.84   1.5   2.4
   0.0   1.5   2.4
   0.784   1.4   2.4
   1.4   0.784   2.4
   0.749   1.3375   2.53125
   1.3375   0.749   2.53125
   0.805   1.4375   2.53125
   1.4375   0.805   2.53125
   0.84   1.5   2.4
   1.5   0.84   2.4
   1.75   0.0   1.875
   1.75   -0.98   1.875
   0.98   -1.75   1.875
   0.0   -1.75   1.875
   2.0   0.0   1.35
   2.0   -1.12   1.35
   1.12   -2.0   1.35
   0.0   -2.0   1.35
   2.0   0.0   0.9
   2.0   -1.12   0.9
   1.12   -2.0   0.9
   0.0   -2.0   0.9
   -0.98   -1.75   1.875
   -1.75   -0.98   1.875
   -1.75   0.0   1.875
   -1.12   -2.0   1.35
   -2.0   -1.12   1.35
   -2.0   0.0   1.35
   -1.12   -2.0   0.9
   -2.0   -1.12   0.9
   -2.0   0.0   0.9
   -1.75   0.98   1.875
   -0.98   1.75   1.875
   0.0   1.75   1.875
   -2.0   1.12   1.35
   -1.12   2.0   1.35
   0.0   2.0   1.35
   -2.0   1.12   0.9
   -1.12   2.0   0.9
   0.0   2.0   0.9
   0.98   1.75   1.875
   1.75   0.98   1.875
   1.12   2.0   1.35
   2.0   1.12   1.35
   1.12   2.0   0.9
   2.0   1.12   0.9
   2.0   0.0   0.45
   2.0   -1.12   0.45
   1.12   -2.0   0.45
   0.0   -2.0   0.45
   1.5   0.0   0.225
   1.5   -0.84   0.225
   0.84   -1.5   0.225
   0.0   -1.5   0.225
   1.5   0.0   0.15
   1.5   -0.84   0.15
   0.84   -1.5   0.15
   0.0   -1.5   0.15
   -1.12   -2.0   0.45
   -2.0   -1.12   0.45
   -2.0   0.0   0.45
   -0.84   -1.5   0.225
   -1.5   -0.84   0.225
   -1.5   0.0   0.225
   -0.84   -1.5   0.15
   -1.5   -0.84   0.15
   -1.5   0.0   0.15
   -2.0   1.12   0.45
   -1.12   2.0   0.45
   0.0   2.0   0.45
   -1.5   0.84   0.225
   -0.84   1.5   0.225
   0.0   1.5   0.225
   -1.5   0.84   0.15
   -0.84   1.5   0.15
   0.0   1.5   0.15
   1.12   2.0   0.45
   2.0   1.12   0.45
   0.84   1.5   0.225
   1.5   0.84   0.225
   0.84   1.5   0.15
   1.5   0.84   0.15
   -1.6   0.0   2.025
   -1.6   -0.3   2.025
   -1.5   -0.3   2.25
   -1.5   0.0   2.25
   -2.3   0.0   2.025
   -2.3   -0.3   2.025
   -2.5   -0.3   2.25
   -2.5   0.0   2.25
   -2.7   0.0   2.025
   -2.7   -0.3   2.025
   -3.0   -0.3   2.25
   -3.0   0.0   2.25
   -2.7   0.0   1.8
   -2.7   -0.3   1.8
   -3.0   -0.3   1.8
   -3.0   0.0   1.8
   -1.5   0.3   2.25
   -1.6   0.3   2.025
   -2.5   0.3   2.25
   -2.3   0.3   2.025
   -3.0   0.3   2.25
   -2.7   0.3   2.025
   -3.0   0.3   1.8
   -2.7   0.3   1.8
   -2.7   0.0   1.575
   -2.7   -0.3   1.575
   -3.0   -0.3   1.35
   -3.0   0.0   1.35
   -2.5   0.0   1.125
   -2.5   -0.3   1.125
   -2.65   -0.3   0.9375
   -2.65   0.0   0.9375
   -2.0   -0.3   0.9
   -1.9   -0.3   0.6
   -1.9   0.0   0.6
   -3.0   0.3   1.35
   -2.7   0.3   1.575
   -2.65   0.3   0.9375
   -2.5   0.3   1.125
   -1.9   0.3   0.6
   -2.0   0.3   0.9
   1.7   0.0   1.425
   1.7   -0.66   1.425
   1.7   -0.66   0.6
   1.7   0.0   0.6
   2.6   0.0   1.425
   2.6   -0.66   1.425
   3.1   -0.66   0.825
   3.1   0.0   0.825
   2.3   0.0   2.1
   2.3   -0.25   2.1
   2.4   -0.25   2.025
   2.4   0.0   2.025
   2.7   0.0   2.4
   2.7   -0.25   2.4
   3.3   -0.25   2.4
   3.3   0.0   2.4
   1.7   0.66   0.6
   1.7   0.66   1.425
   3.1   0.66   0.825
   2.6   0.66   1.425
   2.4   0.25   2.025
   2.3   0.25   2.1
   3.3   0.25   2.4
   2.7   0.25   2.4
   2.8   0.0   2.475
   2.8   -0.25   2.475
   3.525   -0.25   2.49375
   3.525   0.0   2.49375
   2.9   0.0   2.475
   2.9   -0.15   2.475
   3.45   -0.15   2.5125
   3.45   0.0   2.5125
   2.8   0.0   2.4
   2.8   -0.15   2.4
   3.2   -0.15   2.4
   3.2   0.0   2.4
   3.525   0.25   2.49375
   2.8   0.25   2.475
   3.45   0.15   2.5125
   2.9   0.15   2.475
   3.2   0.15   2.4
   2.8   0.15   2.4
   0.0   0.0   3.15
   0.0   -0.002   3.15
   0.002   0.0   3.15
   0.8   0.0   3.15
   0.8   -0.45   3.15
   0.45   -0.8   3.15
   0.0   -0.8   3.15
   0.0   0.0   2.85
   0.2   0.0   2.7
   0.2   -0.112   2.7
   0.112   -0.2   2.7
   0.0   -0.2   2.7
   -0.002   0.0   3.15
   -0.45   -0.8   3.15
   -0.8   -0.45   3.15
   -0.8   0.0   3.15
   -0.112   -0.2   2.7
   -0.2   -0.112   2.7
   -0.2   0.0   2.7
   0.0   0.002   3.15
   -0.8   0.45   3.15
   -0.45   0.8   3.15
   0.0   0.8   3.15
   -0.2   0.112   2.7
   -0.112   0.2   2.7
   0.0   0.2   2.7
   0.45   0.8   3.15
   0.8   0.45   3.15
   0.112   0.2   2.7
   0.2   0.112   2.7
   0.4   0.0   2.55
   0.4   -0.224   2.55
   0.224   -0.4   2.55
   0.0   -0.4   2.55
   1.3   0.0   2.55
   1.3   -0.728   2.55
   0.728   -1.3   2.55
   0.0   -1.3   2.55
   1.3   0.0   2.4
   1.3   -0.728   2.4
   0.728   -1.3   2.4
   0.0   -1.3   2.4
   -0.224   -0.4   2.55
   -0.4   -0.224   2.55
   -0.4   0.0   2.55
   -0.728   -1.3   2.55
   -1.3   -0.728   2.55
   -1.3   0.0   2.55
   -0.728   -1.3   2.4
   -1.3   -0.728   2.4
   -1.3   0.0   2.4
   -0.4   0.224   2.55
   -0.224   0.4   2.55
   0.0   0.4   2.55
   -1.3   0.728   2.55
   -0.728   1.3   2.55
   0.0   1.3   2.55
   -1.3   0.728   2.4
   -0.728   1.3   2.4
   0.0   1.3   2.4
   0.224   0.4   2.55
   0.4   0.224   2.55
   0.728   1.3   2.55
   1.3   0.728   2.55
   0.728   1.3   2.4
   1.3   0.728   2.4
   0.0   0.0   0.0
   1.5   0.0   0.15
   1.5   0.84   0.15
   0.84   1.5   0.15
   0.0   1.5   0.15
   1.5   0.0   0.075
   1.5   0.84   0.075
   0.84   1.5   0.075
   0.0   1.5   0.075
   1.425   0.0   0.0
   1.425   0.798   0.0
   0.798   1.425   0.0
   0.0   1.425   0.0
   -0.84   1.5   0.15
   -1.5   0.84   0.15
   -1.5   0.0   0.15
   -0.84   1.5   0.075
   -1.5   0.84   0.075
   -1.5   0.0   0.075
   -0.798   1.425   0.0
   -1.425   0.798   0.0
   -1.425   0.0   0.0
   -1.5   -0.84   0.15
   -0.84   -1.5   0.15
   0.0   -1.5   0.15
   -1.5   -0.84   0.075
   -0.84   -1.5   0.075
   0.0   -1.5   0.075
   -1.425   -0.798   0.0
   -0.798   -1.425   0.0
   0.0   -1.425   0.0
   0.84   -1.5   0.15
   1.5   -0.84   0.15
   0.84   -1.5   0.075
   1.5   -0.84   0.075
   0.798   -1.425   0.0
   1.425   -0.798   0.0
   
This is the end of the vertex data for the teapot.

------

------------------------------

Posted-Date: Tue, 20 Jan 87 16:45 EST
From: Norm Badler <Badler@cis.upenn.edu>
Subject: the famous teapot - vertices (LONG MESSAGE -- PROGRAM INCLUDED)
Date: Tue, 20 Jan 87 16:45 EST


Forwarded From: "Hatfield, Lansing (Chip)" <hatfield@lll-icdc.arpa> on Tue 20 Jan 1987 at 14:53
Subj: part 2 of teapot code and data
-----
Date: 20 Jan 87 11:19:00 PST

This is the beginning of the vertex data for the teapot.

Patches ~ index: integer vertices: nats

-- rim
16       1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16
16       4  17  18  19  8  20  21  22  12  23  24  25  16  26  27  28
16       19  29  30  31  22  32  33  34  25  35  36  37  28  38  39  40
16       31  41  42  1  34  43  44  5  37  45  46  9  40  47  48  13
-- body
16       13  14  15  16  49  50  51  52  53  54  55  56  57  58  59  60
16       16  26  27  28  52  61  62  63  56  64  65  66  60  67  68  69
16       28  38  39  40  63  70  71  72  66  73  74  75  69  76  77  78
16       40  47  48  13  72  79  80  49  75  81  82  53  78  83  84  57
16       57  58  59  60  85  86  87  88  89  90  91  92  93  94  95  96
16       60  67  68  69  88  97  98  99  92  100  101  102  96  103  104  105
16       69  76  77  78  99  106  107  108  102  109  110  111  105  112  113  114
16       78  83  84  57  108  115  116  85  111  117  118  89  114  119  120  93
-- handle
16       121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136
16       124  137  138  121  128  139  140  125  132  141  142  129  136  143  144  133
16       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
-- spout
16       162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177
16       165  178  179  162  169  180  181  166  173  182  183  170  177  184  185  174
16       174  175  176  177  186  187  188  189  190  191  192  193  194  195  196  197
16       177  184  185  174  189  198  199  186  193  200  201  190  197  202  203  194
-- lid
16       204  204  204  204  207  208  209  210  211  211  211  211  212  213  214  215
16       204  204  204  204  210  217  218  219  211  211  211  211  215  220  221  222
16       204  204  204  204  219  224  225  226  211  211  211  211  222  227  228  229
16       204  204  204  204  226  230  231  207  211  211  211  211  229  232  233  212
16       212  213  214  215  234  235  236  237  238  239  240  241  242  243  244  245
16       215  220  221  222  237  246  247  248  241  249  250  251  245  252  253  254
16       222  227  228  229  248  255  256  257  251  258  259  260  254  261  262  263
16       229  232  233  212  257  264  265  234  260  266  267  238  263  268  269  242
-- bottom
16       270  270  270  270  279  280  281  282  275  276  277  278  271  272  273  274
16       270  270  270  270  282  289  290  291  278  286  287  288  274  283  284  285
16       270  270  270  270  291  298  299  300  288  295  296  297  285  292  293  294
16       270  270  270  270  300  305  306  279  297  303  304  275  294  301  302  271


{----------------------------------------------------------------------------}
{ The following Pascal procedure "Display_Patches" will draw a wire frame
representation of the patch data in the arrays "Ducks" and "Patches". The
loading of the data into the arrays is not shown. The following global
declarations are assumed: }
{----------------------------------------------------------------------------}
CONST
Degree      = 3 ;     { The degree of the Bezier'spline used }
Duck_Count  = 306 ;   { The number of control points "Ducks" }
Patch_Count = 32 ;    { The number of surface patches }

TYPE             
Duck_Type        = RECORD X , Y , Z : Real ; END ;            
                     { Each duck is a three-vector }
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 ;
                     { Each patch points to 16 ducks }
Patch_Array_Type = ARRAY [ 1 .. Patch_Count ] OF Patch_Type ;

VAR
Ducks       : Duck_Array_Type ;    { store ducks here }
Patches     : Patch_Array_Type ;   { which ducks go with which patches }
{----------------------------------------------------------------------------}
{ The procedure "Display_Patches" and its support procedures are given below. 
Note that the parameter "Steps" controls the granularity of the subdivision of
each patch for display. Try a value of 6 to start, then experiment. The 
procedures "Move" and "Draw" should be replaced with the graphics procedures 
appropriate for your system. }           
{----------------------------------------------------------------------------}
PROCEDURE Blend_Vector (D0 , D1 , D2 , D3 : Duck_Type ; T : Real ;  
   VAR Result : Duck_Type) ;
                                        
BEGIN { Calculate vector cubic Bezier' spline value at parameter T }
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 ; { procedure blend_vector }
{----------------------------------------------------------------------------}
PROCEDURE Display_Curve (D0, D1, D2, D3 : Duck_Type ; Steps : Integer) ;

VAR                        { Find "Step+1" points on the spline and }
T, Step  : Real ;          { draw "Step" line segments
Temp     : Duck_Type ;

BEGIN
Step := 1 / Steps ;
T := Step ;
Move (D0.X, D0.Y, D0.Z) ;             { move to start of spline }
WHILE T < 1 + Step / 2 DO
   BEGIN                                                     
   Blend_Vector (D0, D1, D2, D3, T, Temp) ;
   Draw (Temp.X, Temp.Y, Temp.Z) ;    { draw line segment to next point }
   T := T + Step ;
   END ; { While t < }
END ; { procedure display_curve }
{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}
PROCEDURE Display_Patch (VAR Patch : Patch_Type ; Steps : Integer) ;

VAR
T    : Real ;
Step : Real ;
D0, D1, D2, D3 : Duck_Type ;   
                     { ducks for a particular constant U or V value }
BEGIN
Step := 1 / Steps ;
T := 0 ;
WHILE T < 1 + Step / 2 DO
   BEGIN                        { splines of constant U }
   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) ;                                 
                                                                      
                              { splines of constant V }         
   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 ; { While t < }
END ; { procedure display_patch }
{----------------------------------------------------------------------------}
PROCEDURE Display_Patches (Steps : Integer) ;

VAR                     { "Steps" tells how much to divide up the patches }
Index : Integer ; 

BEGIN
FOR Index := 1 TO Patch_Count DO
   BEGIN
   Display_Patch (Patches[Index], Steps) ;
   END ; { for index }
END ; { procedure display_patches }
{ by Charles W. Grant, Lawrence Livermore National Laboratory }
{----------------------------------------------------------------------------}


-- 
Stephen Spencer
Advanced Computing Center for the Arts and Design (ACCAD)
The Ohio State University               | spencer@hardy.cgrg.ohio-state.edu
1224 Kinnear Road, Columbus OH 43212    | spencer@tut.cis.ohio-state.edu

dean@homxb.UUCP (D.JONES) (08/26/88)

This is a translation from pascal to c of the teapot database/program that
was recently posted by:
"Stephen Spencer, Advanced Computing Center for the Arts and Design (ACCAD)"
and written by:
"Charles W. Grant, Lawrence Livermore National Laboratory"

I have hacked it to use SunCore Graphics.  I don't know if it of any use to
anyone, but since I just started mucking about with Graphics recently, It's
really pretty nifty to me ... :-)

If anyone could munge this thing to use polygons so that I could shade them,
Please E-mail it back to be.  I'm just getting to hidden line removal in the
Foley/Van-Dam book,  but the rest is still beyond me.

compile with:

"cc -O -f68881 tea.c patches.c ducks.c -o tea -lcore -lsunwindow -lpixrect -lm"

						Dean S Jones
						AT&T Bell Labs
						HO 1K-426
						(201) 949-4256
						{AT&T Gateways}!homxb!dean

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  ducks.c patches.c tea.c tea.h
# Wrapped by dean@ho5cad on Fri Aug 26 10:58:02 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f ducks.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ducks.c\"
else
echo shar: Extracting \"ducks.c\" \(5617 characters\)
sed "s/^X//" >ducks.c <<'END_OF_ducks.c'
X#include "tea.h"
X
Xdt ducks[DUCK_COUNT] = {
X{1.4,0.0,2.4},
X{1.4,-0.784,2.4},
X{0.784,-1.4,2.4},
X{0.0,-1.4,2.4},
X{1.3375,0.0,2.53125},
X{1.3375,-0.749,2.53125},
X{0.749,-1.3375,2.53125},
X{0.0,-1.3375,2.53125},
X{1.4375,0.0,2.53125},
X{1.4375,-0.805,2.53125},
X{0.805,-1.4375,2.53125},
X{0.0,-1.4375,2.53125},
X{1.5,0.0,2.4},
X{1.5,-0.84,2.4},
X{0.84,-1.5,2.4},
X{0.0,-1.5,2.4},
X{-0.784,-1.4,2.4},
X{-1.4,-0.784,2.4},
X{-1.4,0.0,2.4},
X{-0.749,-1.3375,2.53125},
X{-1.3375,-0.749,2.53125},
X{-1.3375,0.0,2.53125},
X{-0.805,-1.4375,2.53125},
X{-1.4375,-0.805,2.53125},
X{-1.4375,0.0,2.53125},
X{-0.84,-1.5,2.4},
X{-1.5,-0.84,2.4},
X{-1.5,0.0,2.4},
X{-1.4,0.784,2.4},
X{-0.784,1.4,2.4},
X{0.0,1.4,2.4},
X{-1.3375,0.749,2.53125},
X{-0.749,1.3375,2.53125},
X{0.0,1.3375,2.53125},
X{-1.4375,0.805,2.53125},
X{-0.805,1.4375,2.53125},
X{0.0,1.4375,2.53125},
X{-1.5,0.84,2.4},
X{-0.84,1.5,2.4},
X{0.0,1.5,2.4},
X{0.784,1.4,2.4},
X{1.4,0.784,2.4},
X{0.749,1.3375,2.53125},
X{1.3375,0.749,2.53125},
X{0.805,1.4375,2.53125},
X{1.4375,0.805,2.53125},
X{0.84,1.5,2.4},
X{1.5,0.84,2.4},
X{1.75,0.0,1.875},
X{1.75,-0.98,1.875},
X{0.98,-1.75,1.875},
X{0.0,-1.75,1.875},
X{2.0,0.0,1.35},
X{2.0,-1.12,1.35},
X{1.12,-2.0,1.35},
X{0.0,-2.0,1.35},
X{2.0,0.0,0.9},
X{2.0,-1.12,0.9},
X{1.12,-2.0,0.9},
X{0.0,-2.0,0.9},
X{-0.98,-1.75,1.875},
X{-1.75,-0.98,1.875},
X{-1.75,0.0,1.875},
X{-1.12,-2.0,1.35},
X{-2.0,-1.12,1.35},
X{-2.0,0.0,1.35},
X{-1.12,-2.0,0.9},
X{-2.0,-1.12,0.9},
X{-2.0,0.0,0.9},
X{-1.75,0.98,1.875},
X{-0.98,1.75,1.875},
X{0.0,1.75,1.875},
X{-2.0,1.12,1.35},
X{-1.12,2.0,1.35},
X{0.0,2.0,1.35},
X{-2.0,1.12,0.9},
X{-1.12,2.0,0.9},
X{0.0,2.0,0.9},
X{0.98,1.75,1.875},
X{1.75,0.98,1.875},
X{1.12,2.0,1.35},
X{2.0,1.12,1.35},
X{1.12,2.0,0.9},
X{2.0,1.12,0.9},
X{2.0,0.0,0.45},
X{2.0,-1.12,0.45},
X{1.12,-2.0,0.45},
X{0.0,-2.0,0.45},
X{1.5,0.0,0.225},
X{1.5,-0.84,0.225},
X{0.84,-1.5,0.225},
X{0.0,-1.5,0.225},
X{1.5,0.0,0.15},
X{1.5,-0.84,0.15},
X{0.84,-1.5,0.15},
X{0.0,-1.5,0.15},
X{-1.12,-2.0,0.45},
X{-2.0,-1.12,0.45},
X{-2.0,0.0,0.45},
X{-0.84,-1.5,0.225},
X{-1.5,-0.84,0.225},
X{-1.5,0.0,0.225},
X{-0.84,-1.5,0.15},
X{-1.5,-0.84,0.15},
X{-1.5,0.0,0.15},
X{-2.0,1.12,0.45},
X{-1.12,2.0,0.45},
X{0.0,2.0,0.45},
X{-1.5,0.84,0.225},
X{-0.84,1.5,0.225},
X{0.0,1.5,0.225},
X{-1.5,0.84,0.15},
X{-0.84,1.5,0.15},
X{0.0,1.5,0.15},
X{1.12,2.0,0.45},
X{2.0,1.12,0.45},
X{0.84,1.5,0.225},
X{1.5,0.84,0.225},
X{0.84,1.5,0.15},
X{1.5,0.84,0.15},
X{-1.6,0.0,2.025},
X{-1.6,-0.3,2.025},
X{-1.5,-0.3,2.25},
X{-1.5,0.0,2.25},
X{-2.3,0.0,2.025},
X{-2.3,-0.3,2.025},
X{-2.5,-0.3,2.25},
X{-2.5,0.0,2.25},
X{-2.7,0.0,2.025},
X{-2.7,-0.3,2.025},
X{-3.0,-0.3,2.25},
X{-3.0,0.0,2.25},
X{-2.7,0.0,1.8},
X{-2.7,-0.3,1.8},
X{-3.0,-0.3,1.8},
X{-3.0,0.0,1.8},
X{-1.5,0.3,2.25},
X{-1.6,0.3,2.025},
X{-2.5,0.3,2.25},
X{-2.3,0.3,2.025},
X{-3.0,0.3,2.25},
X{-2.7,0.3,2.025},
X{-3.0,0.3,1.8},
X{-2.7,0.3,1.8},
X{-2.7,0.0,1.575},
X{-2.7,-0.3,1.575},
X{-3.0,-0.3,1.35},
X{-3.0,0.0,1.35},
X{-2.5,0.0,1.125},
X{-2.5,-0.3,1.125},
X{-2.65,-0.3,0.9375},
X{-2.65,0.0,0.9375},
X{-2.0,-0.3,0.9},
X{-1.9,-0.3,0.6},
X{-1.9,0.0,0.6},
X{-3.0,0.3,1.35},
X{-2.7,0.3,1.575},
X{-2.65,0.3,0.9375},
X{-2.5,0.3,1.125},
X{-1.9,0.3,0.6},
X{-2.0,0.3,0.9},
X{1.7,0.0,1.425},
X{1.7,-0.66,1.425},
X{1.7,-0.66,0.6},
X{1.7,0.0,0.6},
X{2.6,0.0,1.425},
X{2.6,-0.66,1.425},
X{3.1,-0.66,0.825},
X{3.1,0.0,0.825},
X{2.3,0.0,2.1},
X{2.3,-0.25,2.1},
X{2.4,-0.25,2.025},
X{2.4,0.0,2.025},
X{2.7,0.0,2.4},
X{2.7,-0.25,2.4},
X{3.3,-0.25,2.4},
X{3.3,0.0,2.4},
X{1.7,0.66,0.6},
X{1.7,0.66,1.425},
X{3.1,0.66,0.825},
X{2.6,0.66,1.425},
X{2.4,0.25,2.025},
X{2.3,0.25,2.1},
X{3.3,0.25,2.4},
X{2.7,0.25,2.4},
X{2.8,0.0,2.475},
X{2.8,-0.25,2.475},
X{3.525,-0.25,2.49375},
X{3.525,0.0,2.49375},
X{2.9,0.0,2.475},
X{2.9,-0.15,2.475},
X{3.45,-0.15,2.5125},
X{3.45,0.0,2.5125},
X{2.8,0.0,2.4},
X{2.8,-0.15,2.4},
X{3.2,-0.15,2.4},
X{3.2,0.0,2.4},
X{3.525,0.25,2.49375},
X{2.8,0.25,2.475},
X{3.45,0.15,2.5125},
X{2.9,0.15,2.475},
X{3.2,0.15,2.4},
X{2.8,0.15,2.4},
X{0.0,0.0,3.15},
X{0.0,-0.002,3.15},
X{0.002,0.0,3.15},
X{0.8,0.0,3.15},
X{0.8,-0.45,3.15},
X{0.45,-0.8,3.15},
X{0.0,-0.8,3.15},
X{0.0,0.0,2.85},
X{0.2,0.0,2.7},
X{0.2,-0.112,2.7},
X{0.112,-0.2,2.7},
X{0.0,-0.2,2.7},
X{-0.002,0.0,3.15},
X{-0.45,-0.8,3.15},
X{-0.8,-0.45,3.15},
X{-0.8,0.0,3.15},
X{-0.112,-0.2,2.7},
X{-0.2,-0.112,2.7},
X{-0.2,0.0,2.7},
X{0.0,0.002,3.15},
X{-0.8,0.45,3.15},
X{-0.45,0.8,3.15},
X{0.0,0.8,3.15},
X{-0.2,0.112,2.7},
X{-0.112,0.2,2.7},
X{0.0,0.2,2.7},
X{0.45,0.8,3.15},
X{0.8,0.45,3.15},
X{0.112,0.2,2.7},
X{0.2,0.112,2.7},
X{0.4,0.0,2.55},
X{0.4,-0.224,2.55},
X{0.224,-0.4,2.55},
X{0.0,-0.4,2.55},
X{1.3,0.0,2.55},
X{1.3,-0.728,2.55},
X{0.728,-1.3,2.55},
X{0.0,-1.3,2.55},
X{1.3,0.0,2.4},
X{1.3,-0.728,2.4},
X{0.728,-1.3,2.4},
X{0.0,-1.3,2.4},
X{-0.224,-0.4,2.55},
X{-0.4,-0.224,2.55},
X{-0.4,0.0,2.55},
X{-0.728,-1.3,2.55},
X{-1.3,-0.728,2.55},
X{-1.3,0.0,2.55},
X{-0.728,-1.3,2.4},
X{-1.3,-0.728,2.4},
X{-1.3,0.0,2.4},
X{-0.4,0.224,2.55},
X{-0.224,0.4,2.55},
X{0.0,0.4,2.55},
X{-1.3,0.728,2.55},
X{-0.728,1.3,2.55},
X{0.0,1.3,2.55},
X{-1.3,0.728,2.4},
X{-0.728,1.3,2.4},
X{0.0,1.3,2.4},
X{0.224,0.4,2.55},
X{0.4,0.224,2.55},
X{0.728,1.3,2.55},
X{1.3,0.728,2.55},
X{0.728,1.3,2.4},
X{1.3,0.728,2.4},
X{0.0,0.0,0.0},
X{1.5,0.0,0.15},
X{1.5,0.84,0.15},
X{0.84,1.5,0.15},
X{0.0,1.5,0.15},
X{1.5,0.0,0.075},
X{1.5,0.84,0.075},
X{0.84,1.5,0.075},
X{0.0,1.5,0.075},
X{1.425,0.0,0.0},
X{1.425,0.798,0.0},
X{0.798,1.425,0.0},
X{0.0,1.425,0.0},
X{-0.84,1.5,0.15},
X{-1.5,0.84,0.15},
X{-1.5,0.0,0.15},
X{-0.84,1.5,0.075},
X{-1.5,0.84,0.075},
X{-1.5,0.0,0.075},
X{-0.798,1.425,0.0},
X{-1.425,0.798,0.0},
X{-1.425,0.0,0.0},
X{-1.5,-0.84,0.15},
X{-0.84,-1.5,0.15},
X{0.0,-1.5,0.15},
X{-1.5,-0.84,0.075},
X{-0.84,-1.5,0.075},
X{0.0,-1.5,0.075},
X{-1.425,-0.798,0.0},
X{-0.798,-1.425,0.0},
X{0.0,-1.425,0.0},
X{0.84,-1.5,0.15},
X{1.5,-0.84,0.15},
X{0.84,-1.5,0.075},
X{1.5,-0.84,0.075},
X{0.798,-1.425,0.0},
X{1.425,-0.798,0.0},
X};
END_OF_ducks.c
if test 5617 -ne `wc -c <ducks.c`; then
    echo shar: \"ducks.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f patches.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"patches.c\"
else
echo shar: Extracting \"patches.c\" \(2266 characters\)
sed "s/^X//" >patches.c <<'END_OF_patches.c'
X#include "tea.h"
X
Xpt patches[PATCH_COUNT] = {
X{{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},
X{{4,17,18,19},{8,20,21,22},{12,23,24,25},{16,26,27,28}},
X{{19,29,30,31},{22,32,33,34},{25,35,36,37},{28,38,39,40}},
X{{31,41,42,1},{34,43,44,5},{37,45,46,9},{40,47,48,13}},
X{{13,14,15,16},{49,50,51,52},{53,54,55,56},{57,58,59,60}},
X{{16,26,27,28},{52,61,62,63},{56,64,65,66},{60,67,68,69}},
X{{28,38,39,40},{63,70,71,72},{66,73,74,75},{69,76,77,78}},
X{{40,47,48,13},{72,79,80,49},{75,81,82,53},{78,83,84,57}},
X{{57,58,59,60},{85,86,87,88},{89,90,91,92},{93,94,95,96}},
X{{60,67,68,69},{88,97,98,99},{92,100,101,102},{96,103,104,105}},
X{{69,76,77,78},{99,106,107,108},{102,109,110,111},{105,112,113,114}},
X{{78,83,84,57},{108,115,116,85},{111,117,118,89},{114,119,120,93}},
X{{121,122,123,124},{125,126,127,128},{129,130,131,132},{133,134,135,136}},
X{{124,137,138,121},{128,139,140,125},{132,141,142,129},{136,143,144,133}},
X{{133,134,135,136},{145,146,147,148},{149,150,151,152},{69,153,154,155}},
X{{136,143,144,133},{148,156,157,145},{152,158,159,149},{155,160,161,69}},
X{{162,163,164,165},{166,167,168,169},{170,171,172,173},{174,175,176,177}},
X{{165,178,179,162},{169,180,181,166},{173,182,183,170},{177,184,185,174}},
X{{174,175,176,177},{186,187,188,189},{190,191,192,193},{194,195,196,197}},
X{{177,184,185,174},{189,198,199,186},{193,200,201,190},{197,202,203,194}},
X{{204,204,204,204},{207,208,209,210},{211,211,211,211},{212,213,214,215}},
X{{204,204,204,204},{210,217,218,219},{211,211,211,211},{215,220,221,222}},
X{{204,204,204,204},{219,224,225,226},{211,211,211,211},{222,227,228,229}},
X{{204,204,204,204},{226,230,231,207},{211,211,211,211},{229,232,233,212}},
X{{212,213,214,215},{234,235,236,237},{238,239,240,241},{242,243,244,245}},
X{{215,220,221,222},{237,246,247,248},{241,249,250,251},{245,252,253,254}},
X{{222,227,228,229},{248,255,256,257},{251,258,259,260},{254,261,262,263}},
X{{229,232,233,212},{257,264,265,234},{260,266,267,238},{263,268,269,242}},
X{{270,270,270,270},{279,280,281,282},{275,276,277,278},{271,272,273,274}},
X{{270,270,270,270},{282,289,290,291},{278,286,287,288},{274,283,284,285}},
X{{270,270,270,270},{291,298,299,300},{288,295,296,297},{285,292,293,294}},
X{{270,270,270,270},{300,305,306,279},{297,303,304,275},{294,301,302,271}}
X};
END_OF_patches.c
if test 2266 -ne `wc -c <patches.c`; then
    echo shar: \"patches.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tea.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tea.c\"
else
echo shar: Extracting \"tea.c\" \(3196 characters\)
sed "s/^X//" >tea.c <<'END_OF_tea.c'
X#include "tea.h"
X#include <usercore.h>
X
Xextern dt ducks[DUCK_COUNT];
Xextern pt patches[PATCH_COUNT];
X
Xint pixwindd();
X
Xstruct vwsurf vwsurf = DEFAULT_VWSURF(pixwindd);
X
X#define RPD(i)	((float)i * 0.017453292519)
X
Xmain(argc, argv) int argc; char *argv[];
X{
X	int i = 6;
X
X	if(argc > 1){
X		i = atoi(argv[1]);
X		i = (i > 0) ? i : 6;
X	}
X
X	initialize_core(DYNAMICC, NOINPUT, THREED);
X	initialize_view_surface(&vwsurf, FALSE);
X	select_view_surface(&vwsurf);
X	set_viewport_3(0.0, 1.0, 0.0, 0.75, 0.0, 1.0);
X	set_window(-5.0, 5.0, -5.0, 5.0);
X
X	set_image_transformation_type(XFORM3);
X
X	create_retained_segment(1024);
X	display_patches(i);
X	close_retained_segment(1024);
X	sleep(5);
X
X	set_segment_image_transformation_3(1024, 1.0,1.0,0.15, RPD(90),0.0,0.0, 0.0,0.2,0.0);
X		sleep(2);
X	set_segment_image_transformation_3(1024, 1.0,1.0,0.15, RPD(90),RPD(90),0.0, 0.0,0.2,0.0);
X		sleep(2);
X	set_segment_image_transformation_3(1024, 1.0,1.0,0.15, RPD(45),0.0,0.0, 0.0,0.0,0.0);
X		sleep(2);
X	set_segment_image_transformation_3(1024, 1.0,1.0,0.15, RPD(45),RPD(45),0.0, 0.0,0.0,0.0);
X		sleep(2);
X
X	deselect_view_surface(&vwsurf);
X	terminate_core();
X}
X
Xvoid blend_vector(d0, d1, d2, d3, t, r)
Xdt d0, d1, d2, d3;
Xfloat t;
Xdt *r;
X{
X	r->x = d0.x*(1-t)*(1-t)*(1-t) + d1.x*3*t*(1-t)*(1-t) +
X	       d2.x*3*t*t*(1-t)       + d3.x*t*t*t;
X
X	r->y = d0.y*(1-t)*(1-t)*(1-t) + d1.y*3*t*(1-t)*(1-t) +
X	       d2.y*3*t*t*(1-t)       + d3.y*t*t*t;
X
X	r->z = d0.z*(1-t)*(1-t)*(1-t) + d1.z*3*t*(1-t)*(1-t) +
X	       d2.z*3*t*t*(1-t)       + d3.z*t*t*t;
X}
X
Xvoid display_curve (d0, d1, d2, d3, steps)
Xdt d0, d1, d2, d3;
Xint steps;
X{
X	dt tmp;
X	float t, step;
X
X	t = step = (1.0 / (float)steps);
X
X	move_abs_3(d0.x, d0.y, d0.z);
X	while(t < (1.0 + step / 2.0)){
X		blend_vector(d0, d1, d2, d3, t, &tmp);
X		line_abs_3(tmp.x, tmp.y, tmp.z);
X		t += step;
X	}
X}
X
Xvoid display_patch(patch, steps)
Xpt patch;
Xint steps;
X{
X	float t, step;
X	dt d0, d1, d2, d3;
X
X	t = 0;
X	step = (1.0 / (float)steps);
X	while(t < (1.0 + step / 2.0)) {
X		blend_vector(ducks[patch[0][0]-1],ducks[patch[0][1]-1],
X			     ducks[patch[0][2]-1],ducks[patch[0][3]-1], t, &d0);
X
X		blend_vector(ducks[patch[1][0]-1],ducks[patch[1][1]-1],
X			     ducks[patch[1][2]-1],ducks[patch[1][3]-1], t, &d1);
X
X		blend_vector(ducks[patch[2][0]-1],ducks[patch[2][1]-1],
X			     ducks[patch[2][2]-1],ducks[patch[2][3]-1], t, &d2);
X
X		blend_vector(ducks[patch[3][0]-1],ducks[patch[3][1]-1],
X			     ducks[patch[3][2]-1],ducks[patch[3][3]-1], t, &d3);
X
X		display_curve(d0, d1, d2, d3, steps);
X                                                                      
X		blend_vector(ducks[patch[0][0]-1],ducks[patch[1][0]-1],
X			     ducks[patch[2][0]-1],ducks[patch[3][0]-1], t, &d0);
X
X		blend_vector(ducks[patch[0][1]-1],ducks[patch[1][1]-1],
X			     ducks[patch[2][1]-1],ducks[patch[3][1]-1], t, &d1);
X
X		blend_vector(ducks[patch[0][2]-1],ducks[patch[1][2]-1],
X			     ducks[patch[2][2]-1],ducks[patch[3][2]-1], t, &d2);
X
X		blend_vector(ducks[patch[0][3]-1],ducks[patch[1][3]-1],
X			     ducks[patch[2][3]-1],ducks[patch[3][3]-1], t, &d3);
X
X		display_curve(d0, d1, d2, d3, steps);
X		t += step;
X	}
X}
X
Xdisplay_patches(s) int s;
X{
X	int i;
X
X	for(i=0;i<PATCH_COUNT;i++)
X		display_patch(patches[i], s) ;
X}
END_OF_tea.c
if test 3196 -ne `wc -c <tea.c`; then
    echo shar: \"tea.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tea.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tea.h\"
else
echo shar: Extracting \"tea.h\" \(137 characters\)
sed "s/^X//" >tea.h <<'END_OF_tea.h'
X#define DEGREE		4
X#define DUCK_COUNT	306
X#define PATCH_COUNT	32
X
Xtypedef struct {
X	float x, y, z;
X} dt;
X
Xtypedef int pt[DEGREE][DEGREE];
END_OF_tea.h
if test 137 -ne `wc -c <tea.h`; then
    echo shar: \"tea.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0