
wave=surf{[sin(x)*cos(y)][x:-pi,pi][y:-pi:pi]};

sphere=surf{[2*sin(x)*cos(y),2*sin(x)*sin(y),2*cos(x)]\
            [x=0:pi][y=0:2*pi][sample=20:30]};
TorusX(x,y)=sin(y)*(5+cos(x));
TorusY(x,y)=cos(y)*(5+cos(x));
TorusZ(x,y)=sin(x);
torus=surf{[TorusX(x,y),TorusY(x,y),TorusZ(x,y)]\
           [x=0:2*pi][y=0:2*pi][sample=20:50]};

vurve_example=curve{[sin(x)*(5+cos(20*x)), \
                     cos(x)*(5+cos(20*x)),sin(20*x)]\
                     [x:0,2*pi][sample=2000]};

green_material=material{
                       specular: 0.0 0.7 0.0,
                       diffuse: 0.1 0.5 0.1,
                       shininess: 60.0 };
golden_material=material{
                       ambient: 0.2 0.2 0.2,
                       diffuse: 0.65 0.6 0.0,
                       specular: 0.9 0.9 0.9,
                       shininess: 60.0 };
pink_material=material{
                       ambient: 0.2 0.2 0.2,
                       diffuse: 1.0 0.0 0.9,
                       specular: 1. 1. 1. ,
                       shininess: 45.0 };

blue_material=material{
                       diffuse: 0. 0.0 0.5,
                       specular: 1.0 1.0 1.0,
                       shininess: 15.0 };

complex_object = object{
                 material green_material; torus;
                 material blue_material; sphere;
                 material golden_material;
                 push translate 0.0,8.0,0.0; sphere
                      translate 0.0,-16.0,0.0; sphere
                 pop;
                 material pink_material;
                 push translate 8.0,0.0,0.0; sphere;
                      translate -16.0, 0.0,0.0; sphere;
		 pop;
		}; 
black_sphere=surf{[cos(x)*cos(y),cos(x)*sin(y),sin(x)]
                  [x=-0.5*pi:0.5*pi][y=0:2*pi]};
black_sphere1=surf{[cos(x)*cos(y),cos(x)*sin(y),sin(x)]
                  [x=-0.5*pi:0.5*pi][y=0:2*pi]
                  [orientation: -1]};

spheres=obj{
    material golden_material
        push 
          scale 1.5,1.5,1.5; sphere;
        pop;
     material green_material;
        push
          translate 10,0,0; sphere;
        pop;
     material blue_material
        push
          translate 10,2,3;
          scale 0.5,0.5,0.5; sphere
        pop;
     };

light0=light{ambient: 0,0,0,position: 0,1,0,0, color 1,0,0 };
light1=light{position: 0,0,1,1, color 1,1,1 };
lmd=lmodel{localviewer: 1,attenuation: 0.8,0.3};
yellow_mat=material{diffuse: 0.7,0.7,0};

a=sin(1.0)*sqrt(2.0);
b=a**12 +1.3;
f(x,y,z)=x**2+x*y*z+z*z;
g(x,y)=(x>=y)?(x+a): y*f(y,x,1);
h(x,y)=log(abs(sinh(x+y)));
