Page 1 of 1

mandelbrot exercise v.1

Posted: Wed Jan 16, 2013 4:42 pm
by splasher
suggestions and correction welcomes
i search someone that know how to get better pictures

some pictures

Posted: Thu Jan 17, 2013 12:27 am
by splasher
images generated with mandelbrot_v1.love, then
postprocessed with GIMP filter gaussian 1pixel

Re: mandelbrot exercise v.1

Posted: Thu Jan 17, 2013 3:34 am
by Gravy
Awesome coloring! I wrote a Mandelbrot set program a while back but never got around to making it look pretty.

try change color table

Posted: Thu Jan 17, 2013 10:25 am
by splasher
this table get more colorized

Code: Select all

function buildColorsTab2()
  local v,x,r,g,b,a,c,cn,F F = 7
  a=255
  for x=0,MAXITER do
    v = x/MAXITER -- v->0..1
--    r = 128 + 127 * math.sin(3*math.pi/2 + 2*math.pi*F * v)
--    g = 128 + 127 * math.sin(2*math.pi/2 + 2*math.pi*F * v)
--    b = 128 + 127 * math.sin(1*math.pi/2 + 2*math.pi*F * v)
    r = 128 + 127 * math.sin(290*math.pi/180 + 2*math.pi*F * v)
    g = 128 + 127 * math.sin(120*math.pi/180 + 2*math.pi*F*1.5 * v)
    b = 128 + 127 * math.sin( 73*math.pi/180 + 2*math.pi*F*2.7 * v)    
    tabColor[x]={r,g,b,a}
  end
  --tabColor[MAXITER]={0,0,0,0}
end
this get linear rgb code, so can be used as base to try various colorTables

Code: Select all

function buildColorsTab()
  local x,r,g,b,a,c,cn
  a=255
  for x=0,MAXITER do
    r=0 g=0 b= 0
    if x < 256 then b = x 
    elseif x < 512 then b=255 g = x - 256 
    elseif x < 768 then b=255 g=255 r = x - 512
    else b=255 g=255 r = 255 end
    tabColor[x]={r,g,b,a}
  end
  --tabColor[MAXITER]={0,0,0,0}
end

Re: mandelbrot exercise v.1

Posted: Thu Jan 17, 2013 11:42 am
by kikito
These look very nice :)

Unfortunately, after trying it for a while, I was not able to take nice screenshots.

If I'm understanding the info in the screen correctly, some controls (like the zoom) require a keypad. Unfortunately, my computer does not have one. So I can't use those. I suggest changing them so something else / making an alternative control scheme.

Also, I'm not 100% sure about this, but probably it might be worth looking at using Shaders to generate the set, instead of pure Lua. Surely this will make things go faster. If you are feeling adventurous, you could even add the "gaussian postprocessing" directly there, too.

mandelbrot exercise v.2

Posted: Thu Jan 17, 2013 3:07 pm
by splasher
---------------------------------------------------
changes from v.1
---------------------------------------------------
1) change for Size modifier to not use keypad (now: press key 'a' then key 1..9 )

2) add key (up,dw,left,right,home )to move image for show building when image to build is larger then screen.

3) show a little point where we klik on image (it is not store on image :)

4) add TAPS at bottom of image
---------------------------------------------------

---------------------------------------------------
TIPS:

1) use smaller size ('a' '1' or 'a' '2' ) to preview in fast time , when look intersting or good , switch to higher Size (for example 'a' '6') and press again 'm'
to redraw mandelbrot.

1) image building can be stopped if we just see another zoom point.
---------------------------------------------------

---------------------------------------------------
TIPS for zooming:

1) klik zoom point ( it draw a little white point)

2)
then use 'i' for prepare x10 zoom in (each 'i' defin new zoom in)
or
then use 'o' for prepare x10 zoom out (each 'o' define new zoom out)
or
use 'c' for define new center point

3)
press key 'm' to draw mandelbrot
---------------------------------------------------

---------------------------------------------------
TIPS for window zooming:
1)klik window first corner ( it draw a little white point)
2)then type 2 times key 'q' to acquire first corner
3)klik window second corner ( it draw a little white point)
4)then type 1 time key 'q' to acquire second corner , a square (take the larger of the two window sides) is draw.
5) if ok type key 'w' to draw Mandelbrot
---------------------------------------------------