--Ok, here goes
--I've got some other scripts attached to be able to do a clickzoom, but
that's not important to the drawing

global imageReference, clickTeller, fcx, fcy, fscale

on startMovie
  clickTeller = 0 -- counter for the number of clicks

  fcx = 0
  fcy = 0
  fscale = 0.02
end startmovie


on drawMandel

  fLimit = 4
  repeat with fx = -160 to 159
    repeat with fy =  -100 to 100
      fax = fcx+fx*fscale
      fay = fcy+fy*fscale

      fa1 = fax
      fb1 = fay
      lp = 0

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

      if lp > 255 then lp = 0
      pixel(fx+160,fy+100,lp)
    end repeat
  end repeat
  plotImage()

end


on pixel a,b,c
  if imageReference = void then
    imageReference = image(320,200,8)
  end if

  imageReference.setPixel(a,b,c)

end pixel

on plotImage
  member("imageholder").image = imageReference
end plotimage


--Curious thing is that when using power() it takes more time then just
multiplicating with itsself,
--so I left it like this

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Colin Holgate
Sent: Tuesday, July 03, 2001 5:11 PM
To: [EMAIL PROTECTED]
Subject: RE: <lingo-l> a faster way to draw than using setpixel ??


>Is lingo really that slow - or is it the speed difference between CBrush
and
>setPixel that makes the major difference??

Have you tried commenting out the setpixel line? Then you would know
how much of the time is setpixel, and how much is Lingo. Any chance
of posting the code somewhere?


[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