POV-Ray : Newsgroups : povray.general : Mandelbrot page : Re: Mandelbrot page Server Time
8 Aug 2024 14:23:37 EDT (-0400)
  Re: Mandelbrot page  
From: Warp
Date: 24 Jan 2001 10:41:56
Message: <3a6ef7c4@news.povray.org>
Greg M. Johnson <gre### [at] my-dejanewscom> wrote:
: How close is Tom's code to making one's own *pattern*  for
: one's own original complex math?

  Megapov supports function patterns which you can use to create your
own patterns.
  However, Mandelbrot-type patterns are not possible with the current
implementation since the functions don't support variables nor loops.
  Making a Mandelbrot pattern with a pattern function would require something
like this:

#declare Mandel =
  function
  { Zr=x; Zi=y; n=0;
    while(n<=30 & sqr(Zr)+sqr(Zi)<4)
    { Zi2=sqr(Zi);
      Zi=2*Zr*Zi+x;
      Zr=sqr(Zr)-Zi2+y;
    }
    n/30
  }

  Until functions support variables and while-loops we are out of luck.

  Perhaps shaders are the answer?

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

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