home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Encyclopedia of Graphics File Formats Companion
/
GFF_CD.ISO
/
formats
/
ttddd
/
spec
/
t3d_doc
/
igensurf.zoo
/
examples
/
bpatch.cal
< prev
next >
Wrap
Text File
|
1991-09-28
|
2KB
|
56 lines
{
bpatch.cal: Create a bezier patch
These functions computes a bezier patch when given three functions
Px(i,j), Py(i,j) and Pz(i,j) which returns the x, y and z components
of control point (i,j).
Normally you would define Px, Py and Pz in another file, and use a
command like this:
igensurf -v bpatch.cal data.cal | WriteTDDD > bpatch.obj
}
x(u,v) = patch(u,v,Px);
y(u,v) = patch(u,v,Py);
z(u,v) = patch(u,v,Pz);
patch(u,v,p) =
bezier(
bezier(p(0,0), p(0,1), p(0,2), p(0,3), v),
bezier(p(1,0), p(1,1), p(1,2), p(1,3), v),
bezier(p(2,0), p(2,1), p(2,2), p(2,3), v),
bezier(p(3,0), p(3,1), p(3,2), p(3,3), v),
u);
{ --------------------------------------------------------
This is an example of the three functions which must be supplied
to the bpatch routines.
The patch created by these values is a part of the UTAH teapot.
teapot.cal contain all the definitions necessary to build the
teapot.
Px(i,j) = select( i*4+j+1,
1.500000, 1.500000, 0.840000, 0.000000,
1.750000, 1.750000, 0.980000, 0.000000,
2.000000, 2.000000, 1.120000, 0.000000,
2.000000, 2.000000, 1.120000, 0.000000
);
Py(i,j) = select( i*4+j+1,
0.000000, -0.840000, -1.500000, -1.500000,
0.000000, -0.980000, -1.750000, -1.750000,
0.000000, -1.120000, -2.000000, -2.000000,
0.000000, -1.120000, -2.000000, -2.000000
);
Pz(i,j) = select( i*4+j+1,
2.400000, 2.400000, 2.400000, 2.400000,
1.875000, 1.875000, 1.875000, 1.875000,
1.350000, 1.350000, 1.350000, 1.350000,
0.900000, 0.900000, 0.900000, 0.900000
);
----------------------------------------------------------------- }