chaos control tables for each transform
This commit is contained in:
parent
77fcc571e3
commit
39adb9f697
@ -2,6 +2,7 @@
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -17,6 +18,7 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
}
|
||||
|
||||
unit ControlPoint;
|
||||
|
||||
interface
|
||||
@ -27,8 +29,6 @@ uses
|
||||
Classes, Windows, Cmap, XForm, XFormMan;
|
||||
|
||||
const
|
||||
NXFORMS = 100;
|
||||
|
||||
SUB_BATCH_SIZE = 10000;
|
||||
PROP_TABLE_SIZE = 1024;
|
||||
PREFILTER_WHITE = (1 shl 26);
|
||||
@ -88,6 +88,8 @@ type
|
||||
finalXform: TXForm;
|
||||
finalXformEnabled: boolean;
|
||||
useFinalXform: boolean;
|
||||
soloXform: integer;
|
||||
|
||||
Transparency: boolean;
|
||||
|
||||
xform: array[0..NXFORMS] of TXForm;
|
||||
@ -127,11 +129,13 @@ type
|
||||
jitters: integer;
|
||||
gamma_treshold: double;
|
||||
|
||||
PropTable: array of TXForm;//Integer;
|
||||
// PropTable: array of TXForm;//Integer;
|
||||
FAngle: Double;
|
||||
FTwoColorDimensions: Boolean;
|
||||
|
||||
private
|
||||
invalidXform: TXForm;
|
||||
|
||||
function getppux: double;
|
||||
function getppuy: double;
|
||||
|
||||
@ -222,6 +226,8 @@ begin
|
||||
for i := 0 to NXFORMS do begin
|
||||
xform[i] := TXForm.Create;
|
||||
end;
|
||||
invalidXform := TXForm.Create;
|
||||
soloXform := -1;
|
||||
|
||||
pulse[0][0] := 0;
|
||||
pulse[0][1] := 60;
|
||||
@ -278,6 +284,7 @@ var
|
||||
begin
|
||||
for i := 0 to NXFORMS do
|
||||
xform[i].Free;
|
||||
invalidXform.Free;
|
||||
|
||||
inherited;
|
||||
end;
|
||||
@ -289,10 +296,13 @@ var
|
||||
LoopValue: double;
|
||||
j: integer;
|
||||
TotValue: double;
|
||||
begin
|
||||
SetLength(PropTable, PROP_TABLE_SIZE);
|
||||
|
||||
totValue := 0;
|
||||
k: integer;
|
||||
tp: array[0..NXFORMS] of double;
|
||||
begin
|
||||
// SetLength(PropTable, PROP_TABLE_SIZE);
|
||||
|
||||
//totValue := 0;
|
||||
n := NumXforms;
|
||||
assert(n > 0);
|
||||
|
||||
@ -301,21 +311,45 @@ begin
|
||||
useFinalXform := FinalXformEnabled and HasFinalXform;
|
||||
for i := 0 to n - 1 do begin
|
||||
xform[i].Prepare;
|
||||
totValue := totValue + xform[i].density;
|
||||
//totValue := totValue + xform[i].density;
|
||||
end;
|
||||
invalidXform.PrepareInvalidXForm;
|
||||
|
||||
if soloXform >= 0 then begin
|
||||
for i := 0 to n - 1 do xform[i].noPlot := true;
|
||||
xform[soloXform].noPlot := false;
|
||||
end;
|
||||
|
||||
LoopValue := 0;
|
||||
for i := 0 to PROP_TABLE_SIZE-1 do begin
|
||||
propsum := 0;
|
||||
j := -1;
|
||||
repeat
|
||||
inc(j);
|
||||
propsum := propsum + xform[j].density;
|
||||
until (propsum > LoopValue) or (j = n - 1);
|
||||
PropTable[i] := xform[j];
|
||||
LoopValue := LoopValue + TotValue / PROP_TABLE_SIZE;
|
||||
end;
|
||||
for k := 0 to n - 1 do begin
|
||||
totValue := 0;
|
||||
SetLength(xform[k].PropTable, PROP_TABLE_SIZE);
|
||||
|
||||
for i := 0 to n - 1 do begin
|
||||
tp[i] := xform[i].density * xform[k].modWeights[i];
|
||||
totValue := totValue + tp[i];
|
||||
end;
|
||||
|
||||
if totValue > 0 then begin
|
||||
LoopValue := 0;
|
||||
for i := 0 to PROP_TABLE_SIZE-1 do begin
|
||||
propsum := 0;
|
||||
j := -1;
|
||||
repeat
|
||||
inc(j);
|
||||
propsum := propsum + tp[j];//xform[j].density;
|
||||
until (propsum > LoopValue) or (j = n - 1);
|
||||
|
||||
//assert(tp[j]<>0);
|
||||
|
||||
xform[k].PropTable[i] := xform[j];
|
||||
LoopValue := LoopValue + TotValue / PROP_TABLE_SIZE;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
for i := 0 to PROP_TABLE_SIZE-1 do
|
||||
xform[k].PropTable[i] := invalidXform;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TControlPoint.IterateXY(NrPoints: integer; var Points: TPointsXYArray);
|
||||
@ -323,28 +357,44 @@ var
|
||||
i: Integer;
|
||||
px, py: double;
|
||||
pPoint: PXYPoint;
|
||||
|
||||
xf: TXform;
|
||||
begin
|
||||
px := 2 * random - 1;
|
||||
py := 2 * random - 1;
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPointXY(px,py);
|
||||
xf := xform[0];//random(NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPointXY(px,py);
|
||||
end;
|
||||
|
||||
pPoint := @Points[0];
|
||||
|
||||
if UseFinalXform then
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPointXY(px,py);
|
||||
pPoint^.X := px;
|
||||
pPoint^.Y := py;
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPointXY(px,py);
|
||||
if xf.noPlot then
|
||||
pPoint^.x := MaxDouble // hack
|
||||
else begin
|
||||
pPoint^.X := px;
|
||||
pPoint^.Y := py;
|
||||
end;
|
||||
finalXform.NextPointXY(pPoint^.X, pPoint^.y);
|
||||
Inc(pPoint);
|
||||
end
|
||||
else
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPointXY(px,py);
|
||||
pPoint.X := px;
|
||||
pPoint.Y := py;
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPointXY(px,py);
|
||||
if xf.noPlot then
|
||||
pPoint^.x := MaxDouble // hack
|
||||
else begin
|
||||
pPoint.X := px;
|
||||
pPoint.Y := py;
|
||||
end;
|
||||
Inc(pPoint);
|
||||
end
|
||||
except
|
||||
@ -359,6 +409,8 @@ var
|
||||
i: Integer;
|
||||
p: TCPPoint;
|
||||
pPoint: PCPPoint;
|
||||
|
||||
xf: TXform;
|
||||
begin
|
||||
{$if false}
|
||||
p.x := 2 * random - 1;
|
||||
@ -381,23 +433,35 @@ end;
|
||||
{$ifend}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xform[0];//random(NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
pPoint := @Points[0];
|
||||
|
||||
if UseFinalXform then
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
finalXform.NextPointTo(p, pPoint^);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
if xf.noPlot then
|
||||
pPoint^.x := MaxDouble // hack
|
||||
else
|
||||
finalXform.NextPointTo(p, pPoint^);
|
||||
Inc(pPoint);
|
||||
end
|
||||
else
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
pPoint^.x := p.x;
|
||||
pPoint^.y := p.y;
|
||||
pPoint^.c := p.c;
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
if xf.noPlot then
|
||||
pPoint^.x := MaxDouble // hack
|
||||
else begin
|
||||
pPoint^.x := p.x;
|
||||
pPoint^.y := p.y;
|
||||
pPoint^.c := p.c;
|
||||
end;
|
||||
Inc(pPoint);
|
||||
end
|
||||
except
|
||||
@ -461,6 +525,8 @@ var
|
||||
//px, py, pc1, pc2: double;
|
||||
p: T2CPoint;
|
||||
CurrentPoint: P2Cpoint;
|
||||
|
||||
xf: TXform;
|
||||
begin
|
||||
p.x := 2 * random - 1;
|
||||
p.y := 2 * random - 1;
|
||||
@ -468,13 +534,17 @@ begin
|
||||
p.c2 := random;
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint2C(p);//px, py, pc1, pc2);
|
||||
xf := xform[random(NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint2C(p);//px, py, pc1, pc2);
|
||||
end;
|
||||
|
||||
CurrentPoint := @Points[0];
|
||||
if UseFinalXform then
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint2C(p);//px, py, pc1, pc2);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint2C(p);//px, py, pc1, pc2);
|
||||
CurrentPoint.X := p.x;
|
||||
CurrentPoint.Y := p.y;
|
||||
CurrentPoint.C1 := p.c1;
|
||||
@ -484,7 +554,8 @@ if UseFinalXform then
|
||||
end
|
||||
else
|
||||
for i := 0 to NrPoints - 1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint2C(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint2C(p);
|
||||
CurrentPoint.X := p.x;
|
||||
CurrentPoint.Y := p.y;
|
||||
CurrentPoint.C1 := p.c1;
|
||||
@ -506,6 +577,8 @@ var
|
||||
minx, maxx, miny, maxy: double;
|
||||
Points: TPointsXYArray;
|
||||
CurrentPoint: PXYPoint;
|
||||
|
||||
xf: TXForm;
|
||||
begin
|
||||
Result := false;
|
||||
|
||||
@ -518,12 +591,16 @@ begin
|
||||
Prepare;
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPointXY(px,py);
|
||||
xf := xform[random(NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPointXY(px,py);
|
||||
end;
|
||||
|
||||
CurrentPoint := @Points[0];
|
||||
for i := 0 to n-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPointXY(px,py);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPointXY(px,py);
|
||||
CurrentPoint.X := px;
|
||||
CurrentPoint.Y := py;
|
||||
Inc(CurrentPoint);
|
||||
@ -580,6 +657,9 @@ begin
|
||||
end else if AnsiCompareText(CurrentToken, 'finalxformenabled') = 0 then begin
|
||||
Inc(ParsePos);
|
||||
finalxformenabled := StrToInt(ParseValues[ParsePos]) <> 0;
|
||||
end else if AnsiCompareText(CurrentToken, 'soloxform') = 0 then begin
|
||||
Inc(ParsePos);
|
||||
soloxform := StrToInt(ParseValues[ParsePos]);
|
||||
end else if AnsiCompareText(CurrentToken, 'time') = 0 then begin
|
||||
Inc(ParsePos);
|
||||
time := StrToFloat(ParseValues[ParsePos]);
|
||||
@ -766,6 +846,23 @@ begin
|
||||
Inc(i);
|
||||
end;
|
||||
|
||||
end else if AnsiCompareText(CurrentToken, 'chaos') = 0 then begin
|
||||
i := 0;
|
||||
while true do begin
|
||||
if (ParsePos + 1) >= ParseValues.Count then
|
||||
break;
|
||||
if ParseValues[ParsePos + 1][1] in ['a'..'z', 'A'..'Z'] then
|
||||
break;
|
||||
|
||||
Inc(ParsePos);
|
||||
v := StrToFloat(ParseValues[ParsePos]);
|
||||
xform[CurrentXForm].modWeights[i] := v;
|
||||
Inc(i);
|
||||
end;
|
||||
|
||||
end else if AnsiCompareText(CurrentToken, 'plotmode') = 0 then begin
|
||||
Inc(ParsePos);
|
||||
xform[CurrentXForm].noPlot := StrToInt(ParseValues[ParsePos]) <> 0;
|
||||
end else begin
|
||||
OutputDebugString(Pchar('Unknown Token: ' + CurrentToken));
|
||||
end;
|
||||
@ -1456,8 +1553,9 @@ begin
|
||||
sl.add(format('brightness %f gamma %f vibrancy %f hue_rotation %f cmap_inter %d',
|
||||
[brightness * BRIGHT_ADJUST, gamma, vibrancy, hue_rotation, cmap_inter]));
|
||||
sl.add(format('finalxformenabled %d', [ifthen(finalxformenabled, 1, 0)]));
|
||||
sl.add(format('soloxform %d', [soloXform]));
|
||||
|
||||
for i := 0 to NXFORMS do
|
||||
for i := 0 to NumXForms+1 do //NXFORMS do
|
||||
with xform[i] do begin
|
||||
//if density = 0 then continue; - FinalXform has weight=0
|
||||
|
||||
@ -1485,6 +1583,15 @@ begin
|
||||
sl.Add('postxswap 1')
|
||||
else
|
||||
sl.Add('postxswap 0');
|
||||
|
||||
s := 'chaos';
|
||||
for j := 0 to NumXForms+1 do begin
|
||||
s := s + format(' %g', [modWeights[j]]);
|
||||
end;
|
||||
sl.Add(s);
|
||||
|
||||
sl.Add(Format('plotmode %d', [Ifthen(noPlot, 1, 0)]));
|
||||
|
||||
end;
|
||||
DecimalSeparator := OldDecimalSperator;
|
||||
end;
|
||||
|
@ -198,6 +198,7 @@ end;
|
||||
procedure TFullscreenForm.OnProgress(prog: double);
|
||||
begin
|
||||
prog := (Renderer.Slice + Prog) / Renderer.NrSlices;
|
||||
Canvas.Lock;
|
||||
try
|
||||
if prog >= 1 then
|
||||
begin
|
||||
@ -212,7 +213,8 @@ begin
|
||||
Canvas.Brush.Color := clBlack;
|
||||
Canvas.Fillrect(Rect(7 + Round(prog * (ClientWidth - 14)), ClientHeight - 13, ClientWidth - 7, ClientHeight - 7));
|
||||
end;
|
||||
except
|
||||
finally
|
||||
Canvas.Unlock;
|
||||
end;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007 Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -42,7 +42,7 @@ const
|
||||
RS_XO = 2;
|
||||
RS_VO = 3;
|
||||
|
||||
AppVersionString = 'Apophysis 2.07 beta';
|
||||
AppVersionString = 'Apophysis 2.08 beta pre4.5';
|
||||
|
||||
type
|
||||
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove,
|
||||
@ -4238,6 +4238,22 @@ begin
|
||||
p[2][1] := StrToFloat(Tokens[5]);
|
||||
end;
|
||||
|
||||
v := Attributes.Value('chaos');
|
||||
if v <> '' then begin
|
||||
GetTokens(v, tokens);
|
||||
for i := 0 to Tokens.Count-1 do
|
||||
modWeights[i] := Abs(StrToFloat(Tokens[i]));
|
||||
end;
|
||||
//else for i := 0 to NXFORMS-1 do modWeights[i] := 1;
|
||||
|
||||
v := Attributes.Value('plotmode');
|
||||
if v <> '' then begin
|
||||
if v = 'off' then
|
||||
noPlot := true
|
||||
else
|
||||
noPlot := false;
|
||||
end;
|
||||
|
||||
for i := 0 to NRVAR - 1 do
|
||||
begin
|
||||
vars[i] := 0;
|
||||
|
@ -2,6 +2,7 @@
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -106,6 +107,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -128,11 +130,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x - camX0;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -163,6 +171,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -185,11 +194,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x * cosa + p.y * sina + rcX;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -221,6 +236,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -243,11 +259,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x - camX0;
|
||||
@ -279,6 +302,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -301,11 +325,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x * cosa + q.y * sina + rcX;
|
||||
|
@ -2,6 +2,7 @@
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -133,6 +134,7 @@ var
|
||||
MapColor: ^TFloatColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -155,11 +157,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x - camX0;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -192,6 +200,7 @@ var
|
||||
MapColor: ^TFloatColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXform;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -214,11 +223,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x * cosa + p.y * sina + rcX;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -252,6 +267,7 @@ var
|
||||
MapColor: ^TFloatColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -274,11 +290,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x - camX0;
|
||||
@ -312,6 +335,7 @@ var
|
||||
MapColor: ^TFloatColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -334,11 +358,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x * cosa + q.y * sina + rcX;
|
||||
|
@ -2,6 +2,7 @@
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -126,6 +127,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
t: int64;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
@ -149,11 +151,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x - camX0;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -212,6 +220,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
t: int64;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
@ -235,11 +244,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x * cosa + p.y * sina + rcX;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -299,6 +314,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
t: int64;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
@ -322,11 +338,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x - camX0;
|
||||
@ -386,6 +409,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
t: int64;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
@ -409,11 +433,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x * cosa + q.y * sina + rcX;
|
||||
@ -465,7 +496,7 @@ end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// -- { TRenderer32MM } -------------------------------------------------------
|
||||
// -- { TRenderer48MM } -------------------------------------------------------
|
||||
|
||||
procedure TRenderer48MM.CalcBufferSize;
|
||||
begin
|
||||
|
@ -2,6 +2,7 @@
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -131,6 +132,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -153,11 +155,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x - camX0;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -188,6 +196,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -210,11 +219,17 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
px := p.x * cosa + p.y * sina + rcX;
|
||||
if (px < 0) or (px > camW) then continue;
|
||||
@ -246,6 +261,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -268,11 +284,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x - camX0;
|
||||
@ -304,6 +327,7 @@ var
|
||||
MapColor: PColorMapColor;
|
||||
|
||||
p, q: TCPPoint;
|
||||
xf: TXForm;
|
||||
begin
|
||||
{$ifndef _ASM_}
|
||||
p.x := 2 * random - 1;
|
||||
@ -326,11 +350,18 @@ end;
|
||||
{$endif}
|
||||
|
||||
try
|
||||
for i := 0 to FUSE do
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := fcp.xform[0];//random(fcp.NumXForms)];
|
||||
for i := 0 to FUSE do begin
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
end;
|
||||
|
||||
for i := 0 to SUB_BATCH_SIZE-1 do begin
|
||||
PropTable[Random(PROP_TABLE_SIZE)].NextPoint(p);
|
||||
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
|
||||
xf.NextPoint(p);
|
||||
|
||||
if xf.noPlot then continue;
|
||||
|
||||
finalXform.NextPointTo(p, q);
|
||||
|
||||
px := q.x * cosa + q.y * sina + rcX;
|
||||
|
@ -50,6 +50,8 @@ begin
|
||||
finalXform.Prepare;
|
||||
useFinalXform := fcp.FinalXformEnabled and fcp.HasFinalXform;
|
||||
|
||||
fcp.Prepare;
|
||||
{
|
||||
for i := 0 to n - 1 do begin
|
||||
fcp.xform[i].Prepare;
|
||||
totValue := totValue + fcp.xform[i].density;
|
||||
@ -66,6 +68,7 @@ begin
|
||||
PropTable[i] := fcp.xform[j];
|
||||
LoopValue := LoopValue + TotValue / PROP_TABLE_SIZE;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -511,14 +511,14 @@ begin
|
||||
Result.xform[i].c[2][0] := random * 2 - 1;
|
||||
Result.xform[i].c[2][1] := random * 2 - 1;
|
||||
end;
|
||||
for i := 0 to NXFORMS - 1 do
|
||||
for i := 0 to 100-1 do //NXFORMS - 1 do
|
||||
Result.xform[i].density := 0;
|
||||
for i := 0 to Transforms - 1 do
|
||||
Result.xform[i].density := 1 / Transforms;
|
||||
SetVariation(Result);
|
||||
end;
|
||||
9: begin
|
||||
for i := 0 to NXFORMS - 1 do
|
||||
for i := 0 to 100-1 do //NXFORMS - 1 do
|
||||
Result.xform[i].density := 0;
|
||||
for i := 0 to Transforms - 1 do
|
||||
Result.xform[i].density := 1 / Transforms;
|
||||
|
@ -180,6 +180,11 @@ type
|
||||
procedure GetTransformVariProc(AMachine: TatVirtualMachine);
|
||||
procedure SetTransformVariProc(AMachine: TatVirtualMachine);
|
||||
|
||||
procedure GetTransformChaosProc(AMachine: TatVirtualMachine);
|
||||
procedure SetTransformChaosProc(AMachine: TatVirtualMachine);
|
||||
procedure GetTransformPlotModeProc(AMachine: TatVirtualMachine);
|
||||
procedure SetTransformPlotModeProc(AMachine: TatVirtualMachine);
|
||||
|
||||
procedure GetTransformColorProc(AMachine: TatVirtualMachine);
|
||||
procedure SetTransformColorProc(AMachine: TatVirtualMachine);
|
||||
procedure GetTransformWeightProc(AMachine: TatVirtualMachine);
|
||||
@ -2717,6 +2722,46 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TScriptEditor.GetTransformChaosProc(AMachine: TatVirtualMachine);
|
||||
begin
|
||||
with AMachine do
|
||||
ReturnOutPutArg(cp.xform[ActiveTransform].modWeights[Integer(GetArrayIndex(0))]);
|
||||
end;
|
||||
|
||||
procedure TScriptEditor.SetTransformChaosProc(AMachine: TatVirtualMachine);
|
||||
var
|
||||
v: double;
|
||||
i: integer;
|
||||
begin
|
||||
with AMachine do
|
||||
begin
|
||||
v := GetInputArgAsFloat(0);
|
||||
i := GetArrayIndex(0);
|
||||
if (i >= 0) and (i < NumTransforms) then
|
||||
cp.xform[ActiveTransform].modWeights[i] := v;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TScriptEditor.GetTransformPlotModeProc(AMachine: TatVirtualMachine);
|
||||
begin
|
||||
with AMachine do
|
||||
if cp.xform[ActiveTransform].noPlot then
|
||||
ReturnOutPutArg(1)
|
||||
else
|
||||
ReturnOutPutArg(0);
|
||||
end;
|
||||
|
||||
procedure TScriptEditor.SetTransformPlotModeProc(AMachine: TatVirtualMachine);
|
||||
var
|
||||
v: integer;
|
||||
begin
|
||||
with AMachine do
|
||||
begin
|
||||
v := GetInputArgAsInteger(0);
|
||||
cp.xform[ActiveTransform].noPlot := v <> 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
// -- vars as props --
|
||||
|
||||
procedure TScriptEditor.GetTransformVariationProc(AMachine: TatVirtualMachine);
|
||||
@ -3197,6 +3242,7 @@ begin
|
||||
DefineProp('f', tkFloat, GetTransformFProc, SetTransformFProc);
|
||||
DefineProp('Variation', tkFloat, GetTransformVarProc, SetTransformVarProc, nil, false, 1);
|
||||
DefineProp('Variable', tkFloat, GetTransformVariProc, SetTransformVariProc, nil, false, 1);
|
||||
DefineProp('Chaos', tkFloat, GetTransformChaosProc, SetTransformChaosProc, nil, false, 1);
|
||||
end;
|
||||
Scripter.AddObject('Transform', Transform);
|
||||
|
||||
|
@ -1,3 +1,24 @@
|
||||
{
|
||||
Flame screensaver Copyright (C) 2002 Ronald Hordijk
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
}
|
||||
|
||||
unit XForm;
|
||||
|
||||
interface
|
||||
@ -7,15 +28,18 @@ uses
|
||||
|
||||
const
|
||||
MAX_WEIGHT = 1000.0;
|
||||
|
||||
NXFORMS = 100;
|
||||
|
||||
type
|
||||
TCPpoint = record
|
||||
x, y, c: double;
|
||||
//invisible: boolean;
|
||||
end;
|
||||
PCPpoint = ^TCPpoint;
|
||||
|
||||
TXYpoint = record
|
||||
x, y: double;
|
||||
skip: boolean;
|
||||
end;
|
||||
PXYpoint = ^TXYpoint;
|
||||
|
||||
@ -40,15 +64,21 @@ type
|
||||
c00, c01, c10, c11, c20, c21: double;// unnecessary duplicated variables
|
||||
p00, p01, p10, p11, p20, p21: double;// :-)
|
||||
postXswap: boolean;
|
||||
|
||||
noPlot: boolean;
|
||||
RetraceXform: boolean;
|
||||
// nx,ny,x,y: double;
|
||||
// script: TatPascalScripter;
|
||||
|
||||
modWeights: array [0..NXFORMS] of double;
|
||||
PropTable: array of TXForm;
|
||||
|
||||
Orientationtype: integer;
|
||||
|
||||
private
|
||||
FNrFunctions: Integer;
|
||||
FFunctionList: array of TCalcFunction;
|
||||
FCalcFunctionList: array{[0..64]} of TCalcFunction;
|
||||
FCalcFunctionList: array of TCalcFunction;
|
||||
|
||||
FTx, FTy: double;
|
||||
FPx, FPy: double;
|
||||
@ -74,6 +104,7 @@ type
|
||||
procedure PrecalcSinCos;
|
||||
procedure PrecalcAll;
|
||||
procedure DoPostTransform;
|
||||
procedure DoInvalidOperation;
|
||||
|
||||
procedure Linear; // var[0]
|
||||
procedure Sinusoidal; // var[1]
|
||||
@ -104,6 +135,7 @@ type
|
||||
procedure Noise; // var[26]
|
||||
procedure Blur; // var[27]
|
||||
procedure Gaussian; // var[28]
|
||||
procedure PreBlur; // var[29]
|
||||
|
||||
function Mul33(const M1, M2: TMatrix): TMatrix;
|
||||
function Identity: TMatrix;
|
||||
@ -116,11 +148,11 @@ type
|
||||
destructor Destroy; override;
|
||||
procedure Clear;
|
||||
procedure Prepare;
|
||||
procedure PrepareInvalidXForm;
|
||||
|
||||
procedure Assign(Xform: TXForm);
|
||||
|
||||
procedure NextPoint(var px, py, pc: double); overload;
|
||||
procedure NextPoint(var CPpoint: TCPpoint); overload;
|
||||
procedure NextPoint(var CPpoint: TCPpoint);
|
||||
procedure NextPointTo(var CPpoint, ToPoint: TCPpoint);
|
||||
procedure NextPointXY(var px, py: double);
|
||||
procedure NextPoint2C(var p: T2CPoint);
|
||||
@ -196,6 +228,12 @@ begin
|
||||
vars[0] := 1;
|
||||
for i := 1 to High(vars) do
|
||||
vars[i] := 0;
|
||||
|
||||
for i := 0 to NXFORMS do
|
||||
modWeights[i] := 1;
|
||||
|
||||
noPlot := false;
|
||||
RetraceXform := false;
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -235,6 +273,15 @@ begin
|
||||
// CalculateLength := False;
|
||||
CalculateSinCos := (vars[9] <> 0.0) or (vars[11] <> 0.0) or (vars[19] <> 0.0) or (vars[21] <> 0.0);
|
||||
|
||||
// Pre- variations
|
||||
for i := 0 to NrVar - 1 do begin
|
||||
if (vars[i] <> 0.0) and (LeftStr(Varnames(i), 4) = 'pre_') then begin
|
||||
FCalcFunctionList[FNrFunctions] := FFunctionList[i];
|
||||
Inc(FNrFunctions);
|
||||
end;
|
||||
end;
|
||||
|
||||
// Precalc must be called after pre- vars
|
||||
if CalculateAngle or CalculateSinCos then
|
||||
begin
|
||||
if CalculateAngle and CalculateSinCos then
|
||||
@ -246,14 +293,6 @@ begin
|
||||
Inc(FNrFunctions);
|
||||
end;
|
||||
|
||||
// Pre- variations
|
||||
for i := 0 to NrVar - 1 do begin
|
||||
if (vars[i] <> 0.0) and (LeftStr(Varnames(i), 4) = 'pre_') then begin
|
||||
FCalcFunctionList[FNrFunctions] := FFunctionList[i];
|
||||
Inc(FNrFunctions);
|
||||
end;
|
||||
end;
|
||||
|
||||
// Normal variations
|
||||
for i := 0 to NrVar - 1 do begin
|
||||
if (vars[i] <> 0.0) then begin
|
||||
@ -336,6 +375,23 @@ begin
|
||||
*)
|
||||
end;
|
||||
|
||||
procedure TXForm.PrepareInvalidXForm;
|
||||
begin
|
||||
c00 := 1;
|
||||
c01 := 0;
|
||||
c10 := 0;
|
||||
c11 := 1;
|
||||
c20 := 0;
|
||||
c21 := 0;
|
||||
|
||||
colorC1 := 1;
|
||||
colorC2 := 0;
|
||||
|
||||
FNrFunctions := 1;
|
||||
SetLength(FCalcFunctionList, 1);
|
||||
FCalcFunctionList[0] := DoInvalidOperation;
|
||||
end;
|
||||
|
||||
procedure TXForm.PrecalcAngle;
|
||||
{$ifndef _ASM_}
|
||||
begin
|
||||
@ -436,6 +492,11 @@ asm
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
procedure TXForm.DoInvalidOperation;
|
||||
begin
|
||||
raise EMathError.Create('');
|
||||
end;
|
||||
|
||||
//--0--////////////////////////////////////////////////////////////////////////
|
||||
procedure TXForm.Linear;
|
||||
{$ifndef _ASM_}
|
||||
@ -1615,8 +1676,54 @@ asm
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
//--29--///////////////////////////////////////////////////////////////////////
|
||||
procedure TXForm.PreBlur;
|
||||
{$ifndef _ASM_}
|
||||
var
|
||||
r, sina, cosa: double;
|
||||
begin
|
||||
SinCos(random * 2*pi, sina, cosa);
|
||||
r := vars[29] * (gauss_rnd[0] + gauss_rnd[1] + gauss_rnd[2] + gauss_rnd[3] - 2);
|
||||
gauss_rnd[gauss_N] := random;
|
||||
gauss_N := (gauss_N+1) and $3;
|
||||
|
||||
FTx := FTx + r * cosa;
|
||||
FTy := FTy + r * sina;
|
||||
{$else}
|
||||
asm
|
||||
fld qword ptr [ebx + gauss_rnd]
|
||||
fadd qword ptr [ebx + gauss_rnd+8]
|
||||
fadd qword ptr [ebx + gauss_rnd+16]
|
||||
fadd qword ptr [ebx + gauss_rnd+24]
|
||||
fld1
|
||||
fadd st,st
|
||||
fsubp st(1),st
|
||||
mov edx, [ebx + vars]
|
||||
fmul qword ptr [edx + 29*8]
|
||||
call System.@RandExt
|
||||
mov edx, [ebx + gauss_N]
|
||||
fst qword ptr [ebx + gauss_rnd + edx*8]
|
||||
inc edx
|
||||
and edx,$03
|
||||
mov [eax + gauss_N], edx
|
||||
|
||||
fadd st, st
|
||||
fldpi
|
||||
fmulp
|
||||
fsincos
|
||||
fmul st, st(2)
|
||||
fadd qword ptr [ebx + FTx]
|
||||
fstp qword ptr [ebx + FTx]
|
||||
fmulp
|
||||
fadd qword ptr [ebx + FTy]
|
||||
fstp qword ptr [ebx + FTy]
|
||||
fwait
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
//***************************************************************************//
|
||||
|
||||
(*
|
||||
procedure TXForm.NextPoint(var px, py, pc: double);
|
||||
var
|
||||
i: Integer;
|
||||
@ -1640,6 +1747,7 @@ begin
|
||||
px := FPx;
|
||||
py := FPy;
|
||||
end;
|
||||
*)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
procedure TXForm.NextPoint(var CPpoint: TCPpoint);
|
||||
@ -1799,6 +1907,9 @@ begin
|
||||
|
||||
px := FPx;
|
||||
py := FPy;
|
||||
|
||||
// if PlotMode <> keepPlot then
|
||||
// skip := (PlotMode = neverPlot);
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -1981,6 +2092,7 @@ begin
|
||||
FFunctionList[26] := Noise;
|
||||
FFunctionList[27] := Blur;
|
||||
FFunctionList[28] := Gaussian;
|
||||
FFunctionList[29] := PreBlur;
|
||||
|
||||
//registered
|
||||
// for i := 0 to High(FRegVariations) do
|
||||
@ -2028,6 +2140,12 @@ begin
|
||||
FRegVariations[i].SetVariable(Name, Value);
|
||||
end;
|
||||
end;
|
||||
|
||||
for i := 0 to 100 do
|
||||
modWeights[i] := xform.modWeights[i];
|
||||
|
||||
noPlot := xform.noPlot;
|
||||
RetraceXform := xform.RetraceXform;
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -2036,10 +2154,11 @@ var
|
||||
i, j: integer;
|
||||
Name: string;
|
||||
Value: double;
|
||||
numChaos: integer;
|
||||
begin
|
||||
result := Format(' <xform weight="%g" color="%g" ', [density, color]);
|
||||
if symmetry <> 0 then result := result + format('symmetry="%g" ', [symmetry]);
|
||||
|
||||
|
||||
for i := 0 to nrvar - 1 do begin
|
||||
if vars[i] <> 0 then
|
||||
Result := Result + varnames(i) + format('="%g" ', [vars[i]]);
|
||||
@ -2058,6 +2177,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
numChaos := -1;
|
||||
for i := NXFORMS-1 downto 0 do
|
||||
if modWeights[i] <> 1 then begin
|
||||
numChaos := i;
|
||||
break;
|
||||
end;
|
||||
if numChaos >= 0 then begin
|
||||
Result := Result + 'chaos="';
|
||||
for i := 0 to numChaos do
|
||||
Result := Result + Format('%g ', [modWeights[i]]);
|
||||
Result := Result + '" ';
|
||||
end;
|
||||
|
||||
if noPlot = true then
|
||||
Result := Result + 'plotmode="off" ';
|
||||
|
||||
Result := Result + '/>';
|
||||
end;
|
||||
|
||||
|
@ -6,7 +6,7 @@ uses
|
||||
BaseVariation;
|
||||
|
||||
const
|
||||
NRLOCVAR = 29;
|
||||
NRLOCVAR = 30;
|
||||
|
||||
function NrVar: integer;
|
||||
function Varnames(const index: integer): String;
|
||||
@ -65,7 +65,8 @@ const
|
||||
'cylinder',
|
||||
'noise',
|
||||
'blur',
|
||||
'gaussian_blur'
|
||||
'gaussian_blur',
|
||||
'pre_blur'
|
||||
);
|
||||
begin
|
||||
if Index < NRLOCVAR then
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
Apophysis Copyright (C) 2001-2004 Mark Townsend
|
||||
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007 Piotr Borys, Peter Sdobnov
|
||||
Apophysis Copyright (C) 2007-2008 Piotr Borys, Peter Sdobnov
|
||||
|
||||
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
|
||||
@ -17,12 +17,12 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
}
|
||||
|
||||
{
|
||||
Variation Plugin DLL support for Apophysis:
|
||||
Generic Plugin Support Unit
|
||||
Started by Jed Kelsey, June 2007
|
||||
|
||||
|
||||
|
||||
Portions Copyright (C) 2008 Joel Faber
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user