mandelbrot exercise v.1

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
splasher
Prole
Posts: 21
Joined: Mon Nov 19, 2012 3:10 pm

mandelbrot exercise v.1

Post by splasher »

suggestions and correction welcomes
i search someone that know how to get better pictures
Attachments
mandelbrot_v1.love
(108.25 KiB) Downloaded 232 times
splasher
Prole
Posts: 21
Joined: Mon Nov 19, 2012 3:10 pm

some pictures

Post by splasher »

images generated with mandelbrot_v1.love, then
postprocessed with GIMP filter gaussian 1pixel
Attachments
IMG_1358378274.png
IMG_1358378274.png (2.16 MiB) Viewed 3438 times
IMG_1358379594.png
IMG_1358379594.png (2.26 MiB) Viewed 3438 times
IMG_1358381653.png
IMG_1358381653.png (3.32 MiB) Viewed 3438 times
Gravy
Citizen
Posts: 80
Joined: Sun Jan 22, 2012 10:15 pm
Location: CA, USA

Re: mandelbrot exercise v.1

Post by Gravy »

Awesome coloring! I wrote a Mandelbrot set program a while back but never got around to making it look pretty.
splasher
Prole
Posts: 21
Joined: Mon Nov 19, 2012 3:10 pm

try change color table

Post 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
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: mandelbrot exercise v.1

Post 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.
When I write def I mean function.
splasher
Prole
Posts: 21
Joined: Mon Nov 19, 2012 3:10 pm

mandelbrot exercise v.2

Post 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
---------------------------------------------------
Attachments
mandelbrot_v2a.love
(111.07 KiB) Downloaded 174 times
IMG_1358433486.png
IMG_1358433486.png (444.62 KiB) Viewed 3374 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests