home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Encyclopedia of Graphics File Formats Companion
/
GFF_CD.ISO
/
formats
/
ttddd
/
spec
/
t3d_doc
/
igensurf.zoo
/
examples
/
mountain.cal
< prev
next >
Wrap
Text File
|
1991-09-27
|
756b
|
28 lines
{
mountain.cal: Create a 'mountain' landscape
igensurf -v -s 30 -t 30 mountain.cal | writetddd >mountain.obj
In this example, the noise functions is used to modify an otherwise
simple surface.
Three color functions are defined to add some color to the landscape.
}
#name mountain
#color on
x_scale : 300.0; { Scale factor for the x axis }
y_scale : 300.0; { Scale factor for the y axis }
z_scale : 100.0; { Scale factor for the z axis }
x(u,v) = x_scale * u;
y(u,v) = y_scale * v;
z(u,v) = z_scale * (fnoise3(3*u,3*v,0) + 1);
{ Color functions: Let top be white, and everything else green }
cr(u,v,x,y,z) = if (1.5 * z_scale - z, .2, .9);
cg(u,v,x,y,z) = if (1.5 * z_scale - z, .9, .9);
cb(u,v,x,y,z) = if (1.5 * z_scale - z, .2, .9);