mandelbrot exercise v.1
Posted: Wed Jan 16, 2013 4:42 pm
suggestions and correction welcomes
i search someone that know how to get better pictures
i search someone that know how to get better pictures
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