Sattori » 09 авг 2008, 09:22
Хоссэ
{-------------------------------------- }
{ Perfect Spiral Batch Process }
{ Elizabeth Tomchek 2-3-05 }
{ Makes a batch of perfect spirals. }
{ ------------------------------------- }
fileName := GetSaveFileName;
if CurrentFile = fileName then exit;
DeleteFile(fileName);
for j := 0 to FileCount - 1 do
begin
LoadFlame(j);
ShowStatus('Processing ' + IntToStr(j + 1) + ' of ' + IntToSTr(FileCount));
SetActiveTransform(0);
For k := 0 To NVARS - 1 Do
Begin
Transform.Variation[k] := 0;
End;
Transform.Variation[0] := 1;
with Transform do
begin
a := 0.945943;
b := 0.196814;
c := -0.196814;
d := 0.945943;
e := 0.543808;
f := 0.112068;
end;
w := 0.1/(Transforms-1);
For i := 0 To Transforms - 1 Do
Begin
SetActiveTransform(i);
Transform.Weight := w;
End;
//Adds the third transformation and assigns tube parameters (modification of Shaun's tube generator module).
AddTransform; //Adds the tube transfomation
with Transform do
begin
UpdateFlame := true;
x := (random - 0.5) * 2; //Sets random variable for x translation
y := (random -0.5) * 2; //Sets random variable for y translation
t := random * 360 //Sets random variable for rotation angle
If a > 0 then Transform.linear := 0; //Removes the linear variation if not chosen by the variation generator.
Transform.julian := random; //Sets the tube size randomly from 0-1.
Transform.Variation[a] := random + 1; //Inputs the random variation of size 1-2 from the variation generator
Transform.julian_power := 20 + random*300; //Sets the juliaN power randomly from 20-300 to produce wires or tubes
{If Julian was chosen as the second variation,
then juliascope will be set as the tube variation.}
if a = 35 then Transform.juliascope := random; //Sets the tube size randomly from 0-1.
if a = 35 then Transform.julian_power := 2 + random * 6; //Resets the julian_power function randomly between 2-8.
if a = 35 then Transform.juliascope_power := 20 + random*300; //Sets the juliascope power randomly from 20-320 to produce wires or tubes
if a = 22 then Transform.fan := 10; //When fan is selected, set the variation size to 10
transform.A := 1; //Sets the x coordinate for point x (A,C) = (1,0)
transform.B := -0.5; //Sets the x coordinate for point y (B,D) = (0, 0.5)
transform.C := 0; //Sets the y coordinate for point x (A,C) = (1,0)
transform.D := 0; //Sets the y coordinate for point y (B,D) = (0, 0.5)
transform.E := 0; //Sets the x coordinate for point 0 (E,F) = (0,0)
transform.F := 0; //Sets the y coordinate for point 0 (E,F) = (0,0)
translate (x, y); //Moves the transformation randomly from (-1,-1) to (1,1)
rotate (t); //Rotates the transformation randomly through a possible full circle
scale (2); //Increases the transformation size 2-fold
Transform.Weight := 0.25; //Sets the relative weight to 25%. Adjust to taste manually after running script.
end;
SetActiveTransform(0);
Transform.Weight := 0.9;
Flame.Name := 'PerfectSpiralBatch-' + Flame.Name;
CalculateBounds;
SaveFlame(fileName);
end;
ListFile(fileName);
UpdateFlame := False;