home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Encyclopedia of Graphics File Formats Companion
/
GFF_CD.ISO
/
formats
/
ttddd
/
spec
/
t3d_doc
/
igensurf.zoo
/
examples
/
curtain.cal
< prev
next >
Wrap
Text File
|
1991-09-27
|
773b
|
31 lines
{
curtain.cal: Create a a curtain
igensurf -v -s 50 -t 10 curtain.cal | writetddd >curtain.obj
In this example, the noise functions is used to modify an otherwise
simple surface.
}
#name Curtain
#phong on
x_scale : 1000.0; { Scale factor for the x axis }
y_scale : 100.0; { Scale factor for the y axis }
z_scale : 1000.0; { Scale factor for the z axis }
nbr_folds : 7.2;
max_noise : 0.1;
x(u,v) = x_scale * (u + xnoise(u,v));
y(u,v) = y_scale * (cos(nbr_folds*2*PI*u) + ynoise(u,v));
z(u,v) = z_scale * (v + znoise(u,v));
{ Let noise depend on (1-v) so that the curtain hangs ok at top }
xnoise(u,v) = (1-v) * max_noise * noise3a(5*u,5*v,0);
ynoise(u,v) = (1-v) * max_noise * noise3b(5*u,5*v,0);
znoise(u,v) = (1-v) * max_noise * noise3c(5*u,5*v,0);