<html><head><title>cactus.smpl</title></head><body bgcolor="#FFFFFF">
<pre>
<B>do</B> the_cactus;


<FONT COLOR = "#ff0000"><B>include</B></FONT> 'smpl_textures';
<FONT COLOR = "#ff0000"><B>include</B></FONT> 'smpl_bumps';


<B>object</B> pot <B>is</B>
	cone <B>with</B>
		end1 = 0 0 0;
		end2 = 0 0 2.0;
		radius1 = 1.0;
		radius2 = 1.25;
	<B>end</B>;
	cone <B>with</B>
		end1 = 0 0 0;
		end2 = 0 0 2.0;
		radius1 = .90;
		radius2 = 1.15;
	<B>end</B>; <I>{sides of }</I>
	torus <B>with</B>
		center = 0 0 0;
		normal = 0 0 1;
		inner_radius = 1.15;
		outer_radius = 1.25;
		scale by .5 along 0 0 1;
		move to 0 0 2.0;
	<B>end</B>; <I>{Top cap <B>for</B> the sides }</I>
	sphere <B>with</B> 
		center = 0 0 0;
		radius = 1.0;
		scale by .1 along 0 0 1;
	<B>end</B>; <I>{Base of }</I>
<B>end</B>;	<I>{pot}</I>


<B>object</B> water_catch <B>is</B>
	pot <B>with</B>
		scale by .25 along 0 0 1;
		scale by 1.25 along 1 0 0;
		scale by 1.25 along 0 1 0;
	<B>end</B>;
<B>end</B>;	<I>{water_catch}</I>


<B>object</B> cactus_pot <B>is</B>
	pot <B>with</B> move to 0 0 .1; <B>end</B>;
	water_catch <B>with</B> color = .9 .4 .2; <B>end</B>;
	flat speckled brown paraboloid <B>with</B>
		base = 0 0 1.90;
		top = 0 0 2.0;
		radius = 1.2;
	<B>end</B>; <I>{soil}</I>
<B>end</B>; 	<I>{cactus_pot}</I>


<B>object</B> spike <B>is</B> 

	cone <B>with</B>
		end1 = 0 0 0;
		end2 = 0 0 1;
		radius1 = .08;
		radius2 = .0001;
		color = .8 1 .65;
	<B>end</B>;
<B>end</B>; 	<I>{cactus spike}</I>


<B>object</B> cactus_spindle <B>is</B>
	spike; 
	spike <B>with</B>
		scale by 1.2 along 0 0 1;
		rotate by 30 around 1 0 0;
		rotate by 50 around 0 0 1;
	<B>end</B>;
	spike <B>with</B>
		scale by .8 along 0 0 1;
		rotate by 50 around 1 0 0;
		rotate by 120 around 0 0 1;
	<B>end</B>;
	spike <B>with</B>
		scale by .8 along 0 0 1;
		rotate by 20 around 1 0 0;
		rotate by 200 around 0 0 1;
	<B>end</B>;
	spike <B>with</B>
		scale by .9 along 0 0 1;
		rotate by 60 around 1 0 0;
		rotate by 300 around 0 0 1;
	<B>end</B>;
	spike <B>with</B>
		rotate by 35 around 1 0 0;
		rotate by 10 around 0 0 1;
	<B>end</B>;
<B>end</B>; 	<I>{cactus_spindle}</I>


<B>object</B> cactus_node <B>is</B>
	<FONT COLOR = "#0000ff"><B>scalar</B></FONT> f = 0;
	<FONT COLOR = "#0000ff"><B>scalar</B></FONT> sweep, d, ran, fy, fystep;
	sweep = 180 / 5;

	sphere <B>with</B> 
		center = 0 0 0;
		radius = 1.0;    
	<B>end</B>;
	sphere <B>with</B>
		center = 0 0 0;
		radius = .4;
		scale by .5 along 0 0 1;
		move to 0 0 .9; 
	<B>end</B>; <I>{...comprising the main cactus fleshoid...}</I>

	<B>while</B> f <> 5 <B>do</B>
		torus <B>with</B>
			center = 0 0 0;
			normal = 0 1 0;
			inner_radius = .80;
			outer_radius = 1.08;
			rotate by (f * sweep) around 0 0 1;
		<B>end</B>; <I>{spine_ridges }</I>
		f = f + 1;
	<B>end</B>; <I>{ create spin ridges }</I>

	f = 0;
	ran = 0;
	fystep = .25 / 12;
	<B>while</B> f <> 5 <B>do</B>
		d = 20;
		fy = .20;
		<B>while</B> d <> 140 <B>do</B>
			glossy white cactus_spindle <B>with</B>
				magnify by fy;
				rotate by ran around 0 0 1;
				move to 0 0 1.07;
				rotate by d around 1 0 0;
				rotate by ((f * sweep)+ (sweep / 2)) 
					around 0 0 1;
			<B>end</B>; <I>{ place spike }</I>
			glossy white cactus_spindle <B>with</B>
				magnify by fy;
				rotate by -ran around 0 0 1;
				move to 0 0 1.07;
				rotate by -d around 1 0 0;
				rotate by ((f * sweep)+ (sweep / 2)) 
					around 0 0 1;
			<B>end</B>; <I>{ place spike }</I>
			ran = ran + 33;
			fy = fy + fystep;
			d = d + 10;
		<B>end</B>;
		f = f + 1;
	<B>end</B>; <I>{ place spike loop }</I>
<B>end</B>; 	<I>{cactus_node}</I>


<B>object</B> flower <B>is</B> 
	hyperboloid1 <B>with</B>
		end1 = 0 0 0;
		end2 = 0 0 1;
		radius1 = .1;
		radius2 = .4;
		color = .4 .1 .9;
	<B>end</B>;
	sphere <B>with</B>
		center = 0 0 0;
		radius = .4;
		scale by .25 along 0 0 1;
		move to 0 0 1;
		color = .4 .1 .9;
	<B>end</B>;
	paraboloid <B>with</B>
		base = 0 0 3;
		top = 0 0 .60;
		radius = .95;
		color = .6 .1 .7;
	<B>end</B>;
	cylinder <B>with</B> 
		radius = .05;
		end1 = 0 0 .6;
		end2 = 0 0 1.8;
		rotate by 10 around 1 0 0;
		rotate by 100 around 0 0 1;
		color = red; 
	<B>end</B>;
	cylinder <B>with</B> 
		radius = .05;
		end1 = 0 0 .6;
		end2 = 0 0 1.8;
		rotate by 10 around 1 0 0;
		rotate by 200 around 0 0 1;
		color = red; 
	<B>end</B>;
	cylinder <B>with</B> 
		radius = .05;
		end1 = 0 0 .6;
		end2 = 0 0 1.8;
		rotate by 10 around 1 0 0;
		rotate by 300 around 0 0 1;
		color = red; 
	<B>end</B>;
<B>end</B>;	<I>{<B>object</B> flower}</I>


<B>object</B> flower_stalk <B>is</B>
	sphere <B>with</B>
		center = 0 0 0;
		radius = .25;
		scale by 2 along 0 0 1;
		color = .2 1 .1;
	<B>end</B>;
	glossy bumpy red flower <B>with</B>
		magnify by .25;
		rotate by 20 around 1 0 0;
		rotate by 30 around 0 0 1;
		move to 0 0 .5;
	<B>end</B>;
	glossy bumpy yellow flower <B>with</B>
		magnify by .35;
		rotate by 50 around 1 0 0;
		rotate by 230 around 0 0 1;
		move to 0 0 .5;
	<B>end</B>;
	glossy bumpy purple flower <B>with</B>
		magnify by .31;
		rotate by 70 around 1 0 0;
		rotate by 180 around 0 0 1;
		move to 0 0 .5;
	<B>end</B>;
<B>end</B>; 	<I>{flower_stalk}</I>


<B>object</B> cactus <B>is</B>
	glossy ridged (.9 .5 .3) cactus_pot;
	cactus_node <B>with</B> 
		scale by 2.25 along 0 0 1;
		magnify by .55;
		move to 0 0 3.20;
	<B>end</B>;
	flower_stalk <B>with</B>
		move to 0 0 11.15;
		magnify by .4;
	<B>end</B>;
	<I>{
	glossy speckled grey sphere <B>with</B> 
		center = 0 0 0;
		radius =  5.0;
		scale by .01 along 0 0 1;
		move to 0 0 -.1;
	<B>end</B>; <I>{table}</I>
	}</I>
<B>end</B>;	<I>{<B>object</B> cactus}</I>

 
<B>picture</B> the_cactus <B>with</B>  
	render_mode = shaded;
	facets = 0;
	edges = silhouette;
	field_of_view = 100;
	projection = fisheye;
	eye = (2.5 * cos 0) (3.5 * sin 0) 6.25;
	lookat = 0 0 3;
<B>is</B>
	distant_light <B>with</B> direction = .3 -.5 1; <B>end</B>;
	glossy bumpy dark green cactus; 
<B>end</B>; <I>{the_cactus}</I>

 
<B>anim</B> rolling_cactus <B>with</B>
	facets = 8;
<B>is</B>
	<FONT COLOR = "#0000ff"><B>scalar</B></FONT> rad1 = 180;
	<B>while</B> <B>true</B> <B>do</B>
		the_cactus;
		eye = (2.5 * cos rad1) (3.5 * sin rad1) 6.25;
		<I>{
		eye = 0 -6 2;
		}</I>
		rad1 = rad1 - 3;
	<B>end</B>;
<B>end</B>;	<I>{ rolling_cactus }</I>
</pre>
</body></html>
