POV-Ray : Newsgroups : povray.animations : Valentines day special http://www.infinite-dimensions.net/love Server Time
24 Nov 2024 00:35:25 EST (-0500)
  Valentines day special http://www.infinite-dimensions.net/love (Message 1 to 1 of 1)  
From: Not My Real Email Address
Subject: Valentines day special http://www.infinite-dimensions.net/love
Date: 12 Feb 2003 19:16:23
Message: <3e4ae3d7@news.povray.org>
/* heart_b09.pov
heart
PovRay animation - 1 -> 225 frames
version b09, 13 Feb 2003

-------------------------------------------------------------------------------

copyright 1994 - 2003 Simeon Scott sim### [at] infinite-dimensionsnet

Released under GPL.
See http://www.opensource.org/licenses/gpl-license.php

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software 
Foundation; either version 2 of the License, or (at your option) any later 
version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
Place, Suite 330, Boston, MA 02111-1307 USA

You may distribute this source file and the finished PoVRay animation without 
the intermediate .inc file which is generated.

You may find the latest release version of this source and related copies of 
the output animation at: http://infinite-dimensions.net/love

-------------------------------------------------------------------------------

Please treat this as a pro-peace message and consider that your own actions are
not predetermined, nor are those of humankind's collective bodies.

Ideally this animation would reflect that freedom to change, but due to
limitations in current technology, it just loops over and over (the current
version does not even do that perfectly). Please realise our world does not have
to do that also.

-------------------------------------------------------------------------------

This version is written for MegaPoVPlus 0.5
Some syntax is included, commented out, for IsoPoV.
I think IsoPoV may have had a glitch around y=0 in tracing
the heart(s). Certainly some older version of PoVRay did.
Haven't looked at converting to PoVRay 3.5
Tested using:
Persistence of Vision(tm) Ray Tracer Version 3.1g.mp+.0.5a.0.2.5 
(UniMegaPOVPlus 0.5a mod 0.2.5).Linux.gcc

-------------------------------------------------------------------------------

The heart isosurface formula was found at
http://atrey.karlin.mff.cuni.cz/~0rfelyus/povray/index.html

Note that this takes an INORDINATELY LONG TIME to trace the first time, since a
large (10MB) include file is generated and each object is checked for
overlapping.

Try something like
#nice -19 megapovplus +i heart09.pov -B256 +FT +KI1 +KF225 +KFI1 +KFF225

If running a subsequent trace, it is usually preferrable to take the include
file as PoVRay's input, rather than this file. Make your modifications if any 
to that file, test, repeat, then roll them back into this generator once you 
are happy.

In fact you should first back up the heart_intermediate.inc so I would use
something like
eg

#nice -19 megapovplus +i heart_intermediate_sim10.inc -B256 +FT +KI1 +KF225 
+KFI1 +KFF225

If you impatiently interrupt the first run before the .inc file is complete
it should be useable but will have fewer hearts. You would have to add two
#end statements to the end, which won't be written automatically when you
interrupt.

There is a memory leak in the version of MegaPoV I used. This means stopping 
and restarting the process after it traces some number of images. Note that 
this memory leak does not affect the generation of the include file, so don't 
stop it until it has generated .tga output files. (Unless you need to!)

I provide no way to pause and resume generation of the include file. If you 
want to do this, you'll have to figure out your own way.

The heart object formula provides a heart shape that is off-centre and 
rotated. Applying transforms to the formula would be difficult, but using
pov's transforms is also difficult because of the order in which the
transformations take place. 

**TODO Currently generates 225 - 1 == 224 frames.
		In fact I want 225, or better, 250.
**TODO Three different camera paths, so 750 frames.
**TODO Swing around centre.
**TODO Abstractify and variablise more.
**TODO Make repeat point not jump.
**TODO Clean up math horrors.
**TODO Syntax: I think many floats should have ; at end.
*/

// During the first pass, the include file is generated.
#if (clock=1)
	#declare maxsize=0.08;
	#fopen out "heart_intermediate.inc" write

		// UniMegaPov only
		#write ( out, "#version unofficial MegaPov 0.5\n")

		#write ( out, "#include \"colors.inc\"\n")

		#write ( out, "\n// Animation clock ticks per beat.\n")
		#write ( out, "#declare Period=25;\n")

		#write ( out, "\n// Start clock tick.\n")
		#write ( out, "#if (clock >0)\n")
		#write ( out, "\n// End clock tick.\n")
		#write ( out, "	#if (clock <= Period*9)\n")

		#write ( out, "\n// A hack to offset the start-point of the animation.\n")
// **TODO This was set up for 250 frames.
		#write ( out, "// **TODO This was set up for 250 frames.\n")
		#write ( out, "		#if (clock >= 8* Period)\n")
		#write ( out, "	    	#declare counter = clock - 8*Period;\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (clock < 8*Period)\n")
		#write ( out, "	    	#declare counter = clock + 2*Period;\n")
		#write ( out, "		#end\n")

		#write ( out, "\n		// Instead multiply clock x 5 to make fewer frames please - v8
ONLY!!!\n")
		#write ( out, "		//#declare counter = clock * 5;\n")
		#write ( out, "		#declare counter = clock;\n")

		#write ( out, "\n		// When the large heart should have faded by.\n")
		#write ( out, "		#declare endbigheart=Period*4;\n")

		#write ( out, "\n		#declare look_at_x = 0;\n")
		#write ( out, "		#declare look_at_y = 0;\n")
		#write ( out, "		#declare look_at_z = 0;\n")

		#write ( out, "\n		// Heart beat.\n")
		#write ( out, "		#declare mainscale= 1+(0.1*(sin(counter/Period*2*pi))
+0.2*sin(counter/Period*4*pi) );\n")
		#write ( out, "		#if ((counter-int(counter/Period)*Period)/Period <= 2/3)\n")
		#write ( out, "			#declare mainscale=
mainscale+0.2*pow((sin((counter-int(counter/Period)*Period)/Period*1.5*pi)),2);\n")
		#write ( out, "		#end\n")

		#write ( out, "\n		// Cumulative growth factors.\n")
		#write ( out, "		#if (clock >= Period*3)\n")
		#write ( out, "		#declare mainscale=
mainscale+10*pow((counter-Period*3)/(Period*3),4);\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter >= Period*4)\n")
		#write ( out, "		#declare mainscale=
mainscale+20*pow((counter-Period*4)/(Period*3),4);\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter >= Period*5)\n")
		#write ( out, "		#declare mainscale=
mainscale+30*pow((counter-Period*5)/(Period*3),4);\n")
		#write ( out, "		#end\n")

		#write ( out, "\n		// Red and shiny.\n")
		#write ( out, "		#declare heart_red=texture\n")
		#write ( out, "		{\n")
		#write ( out, "			pigment { rgb <1,0,0>}\n")
		#write ( out, "			finish\n")
		#write ( out, "			{\n")
		#write ( out, "				ambient 0.2\n")
		#write ( out, "				diffuse 0.7\n")
		#write ( out, "				phong 1\n")
		#write ( out, "				phong_size 80\n")
		#write ( out, "				brilliance 2\n")
		#write ( out, "			}\n")
		#write ( out, "		}\n")

		#write ( out, "\n		// Fade out on endbigheart ticks.\n")
		#write ( out, "		#declare heart_fade=texture\n")
		#write ( out, "		{\n")
		#write ( out, "		#if (counter < 0.2*endbigheart)\n")
		#write ( out, "			pigment { rgb <1,0,0>}\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter >= 0.2*endbigheart)\n")
		#write ( out, "			pigment { rgbt
<1,0,0,pow((counter-0.2*endbigheart)/(1.1*endbigheart),2)>}\n")
		#write ( out, "		#end\n")
		#write ( out, "		finish\n")
		#write ( out, "		{\n")
		#write ( out, "			ambient 0.2\n")
		#write ( out, "			diffuse 0.7\n")
		#write ( out, "			#if (counter < 0.2*endbigheart)\n")
		#write ( out, "				phong 1\n")
		#write ( out, "			#end\n")
		#write ( out, "			#if (counter >= 0.2*endbigheart)\n")
		#write ( out, "				phong (1-pow((counter-0.2*endbigheart)/(1.1*endbigheart),2))\n")
		#write ( out, "			#end\n")
		#write ( out, "			phong_size 80\n")
		#write ( out, "			brilliance 2\n")
		#write ( out, "		}\n")
		#write ( out, "	}\n")

		#write ( out, "\n	// from
http://atrey.karlin.mff.cuni.cz/~0rfelyus/povray/index.html\n")
		#write ( out, "	#declare heart=isosurface\n")
		#write ( out, "	{\n")
		#write ( out, "		function cub(2*sqr(x)+sqr(y)+sqr(z)-1) -
(0.1*sqr(x)+sqr(y))*cub(z)\n")
		#write ( out, "		accuracy 0.0000001\n")
		#write ( out, "// IsoPov only\n")
		#write ( out, "//		bounded_by {sphere {<0,0,0>, 1.7}}\n")
		#write ( out, "// UniMegaPov only\n")
		#write ( out, "		contained_by {sphere {<0,0,0>, 1.7}}\n")
		#write ( out, "		// Orient with y=up and z=front.\n")
		#write ( out, "		// See also below.\n")
		#write ( out, "		rotate <0, 90, 0>\n")
		#write ( out, "		rotate < 0, 0, 90>\n")
		#write ( out, "		// Centre on 0, 0, 0.\n")
		#write ( out, "		translate <0, -0.265, 0>\n")
		#write ( out, "		// Make fit into unit sphere at 0, 0, 0.\n")
		#write ( out, "		scale 0.79\n")
		#write ( out, "		// Orient with y=up and z=front.\n")
		#write ( out, "		// Yeah I know, I forget why.\n")
		#write ( out, "		rotate <0, 0, -90>\n")
		#write ( out, "		rotate < 0, -90, 0>\n")
		#write ( out, "	}\n")

		#write ( out, "// For a quicker render, comment the above and uncomment the
below:\n")
		#write ( out, "// #declare heart = sphere { <0, 0, 0>, 1 }\n")
		
		#write ( out, "\n	camera\n")
		#write ( out, "	{\n")
		#write ( out, "		location  <0, 0,-20>\n")
		#write ( out, "		direction <0, 0, 14>\n")
		#write ( out, "		up        <0, 1,  0>\n")
		#write ( out, "		right   <4/3, 0,  0>\n")
		#write ( out, "		#if (counter <= Period*3)\n")
		#write ( out, "		#if (counter <= 2 * Period)\n")
		#write ( out, "			#declare cam=cos(3*pi*counter/(Period*2*3));\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter >= 2 * Period)\n")
		#write ( out, "			#declare cam=-pow(cos(3*pi*counter/(Period*2*3)),2);\n")
		#write ( out, "		#end\n")
		#write ( out, "		translate <8*cam,10*cam,0>\n")
		#write ( out, "	#end\n")
		#write ( out, "\n		/* (REMINDER: \n")
		#write ( out, "		#if (clock >= 8* Period)\n")
		#write ( out, "    		#declare counter = clock - 8*Period;\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (clock < 8*Period)\n")
		#write ( out, "    		#declare counter = clock + 2*Period;\n")
		#write ( out, "		#end\n")
		#write ( out, "		END REMINDER!) */\n")

		#write ( out, "\n		#if (counter <= endbigheart)\n")

		#write ( out, "\n		// Camera moves in from stationary, accelerating, then
gradually\n")
		#write ( out, "		// 		halting like rolling up a hill from - -320 to -20 where it
is\n")
		#write ( out, "		// 		initialized above, ie clock 200 - 250, 1 - 50\n")

		#write ( out, "		// (1+cos(pi*counter/endbigheart))/2) ranges from 1 down to 0\n")

		#write ( out, "\n		translate <0,0,-300*(1+cos(pi*counter/endbigheart))/2>\n")

		#write ( out, "\n		// pow(-1),(int(8*counter/endbigheart)) causes alternating
between - and positive offsets\n")
		#write ( out, "		// (1-(1+cos(8*pi*counter/endbigheart))/2) is 4 hills from 0 up to
1 and back to 0\n")
		
		#write ( out, "\n		#declare look_at_x = look_at_x -
0.1*(1-(1+cos(2*pi*counter/endbigheart))/2);\n")
		#write ( out, "		#declare look_at_y = look_at_y -
0.1*(1-(1+cos(2*pi*counter/endbigheart))/2);\n")
		#write ( out, "		#if (counter <= endbigheart/3)\n")
		#write ( out, "			#declare look_at_x = look_at_x +
0.1*(1-(1+cos(2*pi*counter/(endbigheart/3)))/2);\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter <= endbigheart/4)\n")
		#write ( out, "			#declare look_at_x = look_at_x -
0.14*(1-(1+cos(6*pi*counter/(endbigheart/4)))/2);\n")
		#write ( out, "			#declare look_at_y = look_at_y +\n")
		#write ( out, "				
0.04*(1-(1+cos(2*pi*counter/(endbigheart/4)))/2)*pow(-1,int(3*counter/(endbigheart/4)));\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter > endbigheart/2)\n")
		#write ( out, "			#declare look_at_x = look_at_x +\n")
		#write ( out, "				
0.007*(1-(1+cos(2*pi*(counter-endbigheart/2)/(endbigheart/2)))/2)*pow(-1,int(3*counter/(endbigheart/4)));\n")
		#write ( out, "			#declare look_at_x = look_at_x +
0.01*(1-(1+cos(4*pi*(counter-endbigheart/2)/(endbigheart/2)))/2);\n")
		#write ( out, "			#declare look_at_y = look_at_y +\n")
		#write ( out, "				
0.035*(1-(1+cos(6*pi*(counter-endbigheart/2)/(endbigheart/2)))/2)*pow(-1,int(3*counter/(endbigheart/4)));\n")
		#write ( out, "		#end\n")
		#write ( out, "		#if (counter > 3*endbigheart/5)\n")
		#write ( out, "			#declare look_at_x = look_at_x +
0.006*(1-(1+cos(2*pi*(counter-3*endbigheart/5)/(2*endbigheart/5)))/2);\n")
		#write ( out, "			#declare look_at_y = look_at_y +\n")
		#write ( out, "				
0.003*(1-(1+cos(6*pi*(counter-endbigheart/2)/(endbigheart/2)))/2)*-1*pow(-1,int(4*counter/(endbigheart/4)));\n")
		#write ( out, "			#declare look_at_y = look_at_y +\n")
		#write ( out, "				
0.002*(1-(1+cos(2*pi*(counter-endbigheart/2)/(endbigheart/2)))/2)*-1*pow(-1,int(2*counter/(endbigheart/4)));\n")
		#write ( out, "		#end\n")
		#write ( out, "	#end\n")

		#write ( out, "\n	#if (counter > endbigheart)\n")
		#write ( out, "	// ie clock 50 - 199\n")

		#write ( out, "\n	#if (counter <= 1.5*endbigheart)\n")
		#write ( out, "	// Camera moves in in linear fashion from -0.25 to -0.5\n")
	    #write ( out, "	#end\n")
	
		#write ( out, "\n	#if (counter > 1.5*endbigheart)\n")
		#write ( out, "	// ie clock 149 - 199\n")

		#write ( out, "\n	// Camera moves in from stationary, accelerating, then
gradually\n")
		#write ( out, "	// halting like rolling up a hill.\n")
		#write ( out, "	// (1-(1+cos(2*pi*(counter-2*endbigheart)/endbigheart))/2) ranges
from 0 up to 1\n")
		#write ( out, "		translate
<0,0,15*(1-(1+cos(pi*(counter-1.5*endbigheart)/endbigheart))/2)>\n")
		#write ( out, "	    #end\n")
		#write ( out, "	#end\n")

		#write ( out, "\n	look_at   <0, 0, 0>\n")

// **TODO Add back in the rotation stuff, eg
		#write ( out, "\n	// **TODO Add back in the rotation stuff, eg\n")
		#write ( out, "	//	#if (counter >= Period*3)\n")
		#write ( out, "	//	    rotate y*20*sin(0*2*pi/360+2*pi*counter/(Period*3))\n")
		#write ( out, "	//	#end\n")

		#write ( out, "\n	// Wander center of vision around 'looking' for a heart to zoom in
on.\n")
 		#write ( out, "	//
pow(sin(3*pi*(counter-1.1*endbigheart)/(1.15*endbigheart)),2)\n")
	 		#write ( out, "	// is three steep hills from 0 to 1 and back.\n")
 		#write ( out, "	//
(pow(-1),(int(3*(counter-1.1*endbigheart)/(1.15*endbigheart))))\n")
 		#write ( out, "	// alternates the above offsets between -1 and 1\n")
		
		#write ( out, "	// remember that if you look_at -ve x, then the heart seems to\n")
		#write ( out, "	// move to +ve x\n")
		#write ( out, "		#if (counter > 1.1 * endbigheart)\n")

		#write ( out, "\n		#declare look_at_x = look_at_x +
0.6*(1-(1+cos(2*pi*(counter-1.1*endbigheart)/(1.15*endbigheart)))/2);\n")
		#write ( out, "		#declare look_at_y = look_at_y -
0.4*(1-(1+cos(2*pi*(counter-1.1*endbigheart)/(1.15*endbigheart)))/2);\n")
        
		#write ( out, "\n		#if (counter > 1.8*endbigheart)\n")
		#write ( out, "			#declare look_at_x = look_at_x -
0.1*(1-(1+cos(2*pi*(counter-1.8*endbigheart)/((2.25-1.8)*endbigheart)))/2);\n")
		#write ( out, "		#end\n")
		#write ( out, "	#end            \n")
		#write ( out, "	look_at <look_at_x, look_at_y, look_at_z>\n")
		#write ( out, "}\n")

		#write ( out, "\nlight_source {<10, 10, -15> color White}\n")
		#write ( out, "light_source {<0, 20,0> color White}\n") 
		#write ( out, "light_source {<-5,-5,-8> color White}\n")

		#write ( out, "\nbackground{color White}\n")

		#write ( out, "\n#if (counter <= 1.25*endbigheart)\n")
		#write ( out, "object\n")
		#write ( out, "{\n")
		#write ( out, "	heart\n")
		#write ( out, "	// I forget why.\n")
		#write ( out, "	rotate <0, 90, 0>\n")
		#write ( out, "	rotate < 0, 0, 90>\n")
		#write ( out, "	rotate x*0\n")
		#write ( out, "	rotate z*0\n")
		#write ( out, "    translate <0,-0.05,0>\n")
		#write ( out, "    scale <0.97,0.97,1>\n")
// **TODO Add back in the rotation stuff, eg
		#write ( out, "	// More rotating stuff?.\n")
		#write ( out, "//	rotate y*20*sin(0*2*pi/360+2*pi*counter/(Period*3))\n")
		#write ( out, "	rotate <0, 0, -90>\n")
		#write ( out, "	rotate <0, -90, 0>\n")
		#write ( out, "	scale (mainscale)+", maxsize,"\n")
		#write ( out, "	texture {heart_fade}\n")
		#write ( out, "	rotate <0, 90, 0>\n")
		#write ( out, "	rotate < 0, 0, 90>\n")
		#write ( out, "	hollow\n")
		#write ( out, "}\n")
		#write ( out, "#end\n")
	#fclose out

	/*
	FillHeart macro derived from FillCylinder by Friedemann Schmidt
	Fri### [at] Stonescom
	Raytracing-Gallery http://www.rz.fhtw-berlin.de/~s0049669/
	*/
	#macro FillHeart(SeedNr, MaxDist, Count, MinSize, MaxSize, Angle, Rotation, MaxLoops)
		#local Radius = 1.7;
		#local Seed = seed(SeedNr);
		#local Pos = array[Count]
		#local Size = array[Count]
		#local Ang = array[Count]
		#local RotX = array[Count]
		#local RotY = array[Count]
		#local RotZ = array[Count]
		#local Phase = array[Count]
  
		#local i = 0;
		#local Loops = 0;
		#while (i < Count & Loops < MaxLoops)
			#local Size[i] = rand(Seed)*(MaxSize-MinSize)+MinSize;
    
			#local Break = false;
			#while (Break = false)
				#local X = rand(Seed)*(Radius-Size[i])*2-(Radius-Size[i]);
				#local Y = rand(Seed)*(Radius-Size[i])*2-(Radius-Size[i]);
				#local Z = rand(Seed)*(Radius-Size[i])*2-(Radius-Size[i]);
				#if ( ( pow(2*(X*X)+(Y*Y)+(Z*Z)-1,3) - (0.1*(X*X)+(Y*Y))*(Z*Z*Z) ) <= 0)
					#local Break = true;
				#end
			#end
			#local Pos[i] = <X, Y, Z>;

			// Phi is a random angle in a random direction by which the heart is tilted.
			#local Phi = rand(Seed)*Angle;
			// RotX is the X-axis component of Phi, determined as a random portion of Phi.
			#local RotX[i] = rand(Seed)*Phi;
			// RotZ is the Z-axis component, determined such that the heart is declined by Phi.
			// If this sounds complex, it is.
			#local RotZ[i] = asin( sqrt( sin(Phi*2*pi/360)*sin(Phi*2*pi/360) -
sin(RotX[i]*2*pi/360)*sin(RotX[i]*2*pi/360) ) );

			#local RotY[i] = rand(Seed)*Rotation;

			#local Phase[i] = rand(Seed)*2*pi;
    
			#local Size[0] = MaxSize;
			#local Pos[0] = <0,0,0>;
			#local RotX[0] = 0;
			#local RotY[0] = 0;
			#local RotZ[0] = 0;
			#local Phase[0] = 0;

			#local ShowIt = true;
			#local j = 0;
			#while (j < i & ShowIt = true)
				#if (vlength(Pos[j]-Pos[i])-Size[j]-Size[i] < 0)
					#local ShowIt = false;
				#end
				#local j = j + 1;
			#end

			#if (ShowIt = true)    
				#debug concat("Heart ", str(i+1, 0, 0), "\n")
				#fopen out "heart_intermediate.inc" append
					#write (out, "// Heart ", str(i+1, 0, 0), "\n")
					#write (out, "\n#local scalefactor= 1+(0.1*(sin(", str(Phase[i], 0, 4),
"+clock/Period*2*pi)) +0.2*sin(", str(Phase[i], 0, 4), "+clock/Period*4*pi) );\n")
					#write (out, "#if ((", str(Phase[i], 0, 4), "/2*pi+clock-int(", str(Phase[i], 0,
4), "/2*pi+clock/Period)*Period)/Period <= 2/3)\n")
					#write (out, "	#local scalefactor= scalefactor+0.2*pow((sin((", str(Phase[i], 0,
4), "/2*pi+clock-int(", str(Phase[i], 0, 4),
"/2*pi+clock/Period)*Period)/Period*1.5*pi)),2);\n" )
					#write (out, "#end\n")

					#write ( out, "\nobject\n")
					#write ( out, "{\n")
					#write ( out, "	heart\n")
					#write ( out, "	texture {heart_red}\n")
					#write ( out, "	scale ", Size[i], "*scalefactor\n\trotate <0, 90, 0>\n\trotate <
0, 0, 90>\n")
					#write ( out, "	rotate x*", RotX[i], "\n")
					#write ( out, "	rotate z*", RotZ[i], "\n")
					#write ( out, "	rotate y*20*sin(", RotY[i], "*2*pi/360+2*pi*clock/(Period*3))\n")
					// First heart is not offset from <0, 0, 0>
					# if (i > 0)
						#write ( out, "	rotate <0, 0, -90>\n")
						#write ( out, "	rotate <0, -90, 0>\n")
						#write ( out, "	translate ", Pos[i], "*0.79 * mainscale\n")
						#write ( out, "	rotate <0, 90, 0>\n")
						#write ( out, "	rotate < 0, 0, 90>\n")
						#write ( out, "	translate <0, -0.265, 0> * mainscale\n")
					#else
						#write ( out, "	// First heart not offset from <0, 0, 0> - c.f. next heart.\n")
					#end
					#write ( out, "}\n")
				#fclose out

				#local i = i + 1;
				#local Loops = 0;
			#else
				#local Loops = Loops + 1;
			#end
		#end
		// Close the loops in output file.
// **TODO Hope this works in this place.
		#write ( out, "	#end\n")
		#write ( out, "#end\n")
		#if (i < Count)
// **TODO Not sure if this next line works the way I think.
			#debug concat(">>> Reached MaxLoops ", str(MaxLoops, 0, 0), " after ", str(i, 0,
0), " hearts!\n")
		#end
	#end

	// Now call the FillHeart macro just above.
	//        Seed  MaxDist, Count, MinSize, MaxSize, Angle, Rotation, MaxLoops
	FillHeart(12354, 0.05,    100,    0.04,  maxsize,  15,     360,     8500)
#end     

// Now having generated the large include file, include it and finish rendering.    
#include "heart_intermediate.inc"


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.