suggestions and correction welcomes
i search someone that know how to get better pictures
mandelbrot exercise v.1
mandelbrot exercise v.1
- Attachments
-
mandelbrot_v1.love
- (108.25 KiB) Downloaded 233 times
some pictures
images generated with mandelbrot_v1.love, then
postprocessed with GIMP filter gaussian 1pixel
postprocessed with GIMP filter gaussian 1pixel
Re: mandelbrot exercise v.1
Awesome coloring! I wrote a Mandelbrot set program a while back but never got around to making it look pretty.
try change color table
this table get more colorized
this get linear rgb code, so can be used as base to try various colorTables
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
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
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: mandelbrot exercise v.1
These look very nice ![Smile :)](./images/smilies/ms-smile.png)
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.
![Smile :)](./images/smilies/ms-smile.png)
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.
mandelbrot exercise v.2
---------------------------------------------------
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![Smile :)](./images/smilies/ms-smile.png)
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
---------------------------------------------------
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
![Smile :)](./images/smilies/ms-smile.png)
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 176 times
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest