Logo by dainbramage - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. April 26, 2024, 05:11:40 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Buddhabulb?  (Read 966 times)
0 Members and 1 Guest are viewing this topic.
Schlega
Navigator
*****
Posts: 63


« on: July 17, 2010, 06:16:07 AM »

I would like to make a Buddhabrot style image of the Mandelbulb, but the program I had planned on using to render it (ImageVis3d) does not run on my computer. So far, all I have done is a Matlab script to calculate the data. (I know it's terribly slow. I just use matlab scripts to get the math right before I worry about the details of implemennting it in a real programming language.)

If anyone wants to finish this, I'd love to see the results.
Code:
xmin = -2;
xmax = 2;
%ymin = -2;
%ymax = 2;
%zmin = -2;
%zmax = 2;

xres = 256;
%yres = 256;
%zres = 256;

xVoxSize = (xmax-xmin)/xres;
xcenters = (xmin + xVoxSize/2):xVoxSize:(xmax - xVoxSize/2);

A = zeros(xres,yres,zres);

numPoints = 1000;
maxIter = 20;
bailout = 4;
path = zeros(3,0);

for ndx = 1:numPoints
point = rand(3,1)*4 - 2;
p = point;
for mdx = 1:maxIter
p = multiply(p,p);
point = [point,p];
if (p'*p > bailout)
path = [path,point];
continue;
end
end
end

[m,n] = size(path);

for ndx = 1:n
xndx = abs(xcenters-path(1,ndx));
yndx = abs(xcenters-path(2,ndx));
zndx = abs(xcenters-path(3,ndx));
x = find(xndx == min(xndx));
y = find(yndx == min(yndx));
z = find(zndx == min(zndx));
A(x,y,z) = A(x,y,z)+1;
end
A
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.184 seconds with 24 queries. (Pretty URLs adds 0.006s, 2q)