Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 33

Thread: Hoi, Snee!

  1. #21
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    k-o.

    If you feel like it

    It sort of works now, so.

  2. Lounge   -   #22
    Barbarossa's Avatar mostly harmless
    Join Date
    Jun 2002
    Location
    Over here!
    Posts
    15,180
    Professional pride, and all that

  3. Lounge   -   #23
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    Aight.

    Can't argue with that

  4. Lounge   -   #24
    Barbarossa's Avatar mostly harmless
    Join Date
    Jun 2002
    Location
    Over here!
    Posts
    15,180
    Oooh - did you click on "Show Attractors"?

    As far as I know, that feature is unique to me, I've never seen another one do that sort of pattern

  5. Lounge   -   #25
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    TBH, 'cos of the number issue, I think something is a bit off, 'cos I don't get very interesting patterns at all.

    Wasn't gonna say nothing tho', 'cos you seemed well chuffed with it, like

    Since you are fixing it tho, I'll wait and have a look tomorrow.

  6. Lounge   -   #26
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    Actually, when I started messing around with it just now, everything got waaay kewler.

    I should have tried some more, silly me.


    It's only the numbers that are ghey.


    EDit: Oh, and since I can't see the code, I dunno what it takes, but would it be possible to set the pixel-size of the sides separately? And could you up the max to 1280 :gotsideas:
    Last edited by Snee; 03-29-2007 at 08:01 PM.

  7. Lounge   -   #27
    Barbarossa's Avatar mostly harmless
    Join Date
    Jun 2002
    Location
    Over here!
    Posts
    15,180
    Quote Originally Posted by Snee View Post
    TBH, 'cos of the number issue, I think something is a bit off, 'cos I don't get very interesting patterns at all.

    Wasn't gonna say nothing tho', 'cos you seemed well chuffed with it, like

    Since you are fixing it tho, I'll wait and have a look tomorrow.
    Yeah, because it bombed out because of the numbers problem, it didn't set up the colours properly

    No wonder you thought it was shit. You probably think I'm an idiot

    I've fixed it now anyway.

    Changing the lengths of the each of sides is a good idea, traditionally the images are always square, so that's what I did, and then I did ridiculously elaborate processing to set the window size to match the image size, and vice versa

    I should have optimised it for desktop dimensions. Oh well, that would be a bit of a rewrite, maybe I will have a go, but not today. I'd have to change the drawing algorithm, but I've forgotten how it works, because it's multi-threaded

  8. Lounge   -   #28
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    Oh, ok, don't worry too much about it. I just thought it'd be sweet if it generated desktop bgs straight away, like.

    Also, when I fiddled with it (the messed-up one), it looked ok, so I don't think it's a bad application.
    Made some really kewl patterns after a bit

    I was tinkering with gimp later on, with the fractalexplorer-filter, and found that I could generate similar patterns as wot yours does with the attractors on.

    Yours is more fun tho'.


    Initially tho', I was wondering a bit if I was doing something wrong, like
    Last edited by Snee; 03-30-2007 at 02:45 PM. Reason: enriching the experience.

  9. Lounge   -   #29
    Barbarossa's Avatar mostly harmless
    Join Date
    Jun 2002
    Location
    Over here!
    Posts
    15,180
    I just had a look, and converting that program to do them non-square would be teh hard

    Mainly because it would fuck up all the co-ordinates and that when you select the next image to draw.

    Anyway, attached is the version that should work for you without the errors.

    If you're interested, here is the source for the drawing algorithm

    Code:
    unit MandelCalc;
    
    interface
    
    uses
      Windows, Classes, Graphics, SysUtils;
    
    type
      TMandelCalc = class(TThread)
      private
        { Private declarations }
        X, Y, Len, Colour, Focus, XStep : integer;
        DrawRect : TRect;
        ColPoints : Array [0..1023] of integer;
        procedure Synchro;
      protected
        procedure Execute; override;
      public
        { Public declarations }
        constructor Create(InitR, InitI, Size, SeedR, SeedI : Extended;
                           MaxLen, MaxIterate, ParmStep : integer;
                           FracJulia, dspAttract, dspMono : boolean);
      end;
    
    implementation
    
    uses
      MandelScreen, MandelOptions;
    
    constructor TMandelCalc.Create(InitR, InitI, Size, SeedR, SeedI : Extended;
                                   MaxLen, MaxIterate, ParmStep : integer;
                                   FracJulia, dspAttract, dspMono : boolean);
    begin
      XStep := ParmStep;
      FreeOnTerminate := True;
      Priority := tpTimeCritical;
      inherited Create(False);
    end;
    
    procedure TMandelCalc.Execute;
    var
      R, I, Step : Extended;
      CountX, CountY : integer;
    
      function Calculate(R0, I0: Extended):integer;
      const
        RequiredRep = 1;
      var
        Iterate : integer;
        R1, I1, R2, I2 : Extended;
        LastR, LastI : Extended;
        CheckEvery, Periodicity, LastPeriod, NumRep : integer;
    
        procedure CheckAttractor;
        begin
          if (abs(R1 - LastR) < Step) and (abs(I1 - LastI) < Step) then
          begin
            if LastPeriod = Periodicity then
            begin
              NumRep := NumRep + 1;
              if NumRep = RequiredRep then
              begin
                if dspAttract then
                  Colour := Iterate;
                Iterate := MaxIterate + 1;
              end
            end
            else
            begin
              LastPeriod := Periodicity;
              Periodicity := 1;
            end
          end
          else
          begin
            Periodicity := Periodicity + 1;
            if Periodicity >= CheckEvery then
            begin
              CheckEvery := CheckEvery * 2;
              Periodicity := 1;
              LastR := R1;
              LastI := I1;
              NumRep := 0;
            end;
          end;
        end;
    
      begin
        Iterate := 1;
        R1 := R0;
        I1 := I0;
    
        if FracJulia then
        begin
          R0 := SeedR;
          I0 := SeedI;
        end;
    
        LastR := 0;
        LastI := 0;
        NumRep := 0;
        Periodicity := 1;
        LastPeriod := 2;
        CheckEvery := 2;
    
        Colour := 0;
    
        while (sqr(R1) + sqr(I1) < 4) and (Iterate <= MaxIterate) do
        begin
          Iterate := Iterate + 1;
          R2 := sqr(R1) - sqr(I1) + R0;
          I2 := 2 * R1 * I1 + I0;
          R1 := R2;
          I1 := I2;
          {if (not FracJulia) or dspAttract then} CheckAttractor;
        end;
        if Iterate > MaxIterate then
          Iterate := 0;
        if (Colour = 0) and not dspAttract then
          Colour := Iterate;
    
        if Colour = 0 then
          Result := OptionsForm.ColourSet
        else
        begin
          if dspMono then
            Result := (Colour mod 2) * $FFFFFF
          else
            Result := OptionsForm.CalcColour(Colour);
        end;
      end;
    
    begin
      Focus := MaxLen - 1;
    {  Focus := 1;  }
    
      repeat
        Len := MaxLen div (Focus + 1);
        Step := Size / (Focus + 1);
        CountX := Focus div 2;
        while (CountX <= Focus) and (CountX >= 0) do
        begin
          X := CountX * Len;
          R := InitR + (CountX * Step);
          for CountY := 0 to Focus do
          begin
            colPoints[CountY] := -1;
    
    {        if ((CountX mod 2) + (CountY mod 2) <> 0)
                or ((CountX = 0) and (CountY = 0)) then   }
    
            begin
              Y := CountY * Len;
              I := InitI - (CountY * Step);
              Colour := Calculate(R, I);
              ColPoints[CountY] := Colour;
            end;
          end;
    
          if MandelScreen.StopThread then
            exit;
    
          synchronize(Synchro);
          CountX := CountX + XStep;
        end;
        Focus := (Focus * 2) + 1;
      until Focus > MaxLen;
    
    end;
    
    procedure TMandelCalc.Synchro;
    var
      LoopY : integer;
    begin
      for LoopY := 0 to Focus do
      begin
        if ColPoints[LoopY] <> -1 then
          begin
          Y := LoopY * Len;
          if Len > 1 then
          begin
            DrawRect := Rect(X, Y, X + Len, Y + Len);
            with MandelScreen.Bitmap.Canvas do
            begin
              Brush.Color := ColPoints[LoopY];
              FillRect(DrawRect);
            end;
          end
          else
          begin
            MandelScreen.Bitmap.Canvas.Pixels[X,Y] := ColPoints[LoopY];
          end;
        end;
      end;
    
      DrawRect := Rect(X, 0, X + Len, MaxLen);
      frmMandelbrot.imgMandel.Canvas.CopyRect(DrawRect,MandelScreen.Bitmap.Canvas,DrawRect);
    end;
    
    end.
    Attached Files Attached Files

  10. Lounge   -   #30
    JPaul's Avatar Fat Secret Agent
    Join Date
    Nov 2004
    Posts
    16,867
    Spammer

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •