I posted it to this list, like 3 months ago i guess...

Basically, you can draw a mandelbrot like this:

<snip>
  fcx = 0  ---- center x
  fcy = 0 ----- center y
  fscale = 0.02 ---- scale
  fLimit = 4 ----- level of precision
  colorLimit = 255 --- colordepth(integer)
  resHor = 320
  resVert = 200


  repeat with fx = -(resHor/2) to (resHor/2)
    repeat with fy =  -(resVert/2) to (resVert/2)
      fax = fcx+fx*fscale
      fay = fcy+fy*fscale

      fa1 = fax
      fb1 = fay
      lp = 0---colorcounter

      repeat while (lp <=colorLimit) and ((fa1*fa1)+(fb1*fb1)<=fLimit) --
iterate
        lp = lp+1
        fa2=fa1*fa1-fb1*fb1+fax
        fb2=2*fa1*fb1+fay
        fa1=fa2
        fb1=fb2
      end repeat

      if lp > colorLimit then lp = 0

      imageReference.setPixel(fx+(resHor/2),fy+(resVert/2),lp)

    end repeat
  end repeat
<snip>


Have fun with it...
If you can find a more efficient way to do it, let me know....
It's useless to do the obvious optimizations, because the lack of speed lies
in the repeat loops...

Chris.
----- Original Message -----
From: "Frank Di Luzio" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 10:11 AM
Subject: <lingo-l> Lingo Speed was [Keyword search of text in flash in
Director]


> and lingo isn't all that fast
> either - the other day i wrote this fractal thingie to test the speed of
> lingo vs c++ - the c version was like quadraticly faster - it did a
640x480
> 32bit render about 500 times faster than the lingo version....

Yeh, tell me about it.  I've been working on a transition code that uses
bitmaps or Flash members for the transition. It's ashame that it takes so
long to execute. No matter how hard I try, I'll never get the performance
that a transition xtra offers. But its still cool to be able to make any
transition you want and I do get reasonable speed on a 300 mhz machine.

on a side note, I would like to see how a fractal equation works using
lingo.  I've seen the "mandelbaum" equation (don't know the english word,
but its that classic example of the first fractal images) but I wouldn't
know how to to use it, and how to feed the results from equation back into
it. If you had an example I could look at maybe it will help me understand
it.

Frank
====================================

DIA3 GMBH
Metzstrasse 14
81667 M�nchen

Tel:  089 458738 0
Fax: 089 458738 99
Leonardo: 089 45873871

[EMAIL PROTECTED]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]




[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to