Title: Beginner's problems with the Mandelbox formula Post by: smooo on January 24, 2011, 12:47:08 AM Hey guys,
I'm totally new to fractals but always was impressed by these great images. In university my friend and I have this project to implement a version of Mandelbox with zoom and stuff. As I never worked with fractals I'm not that sure about my interpretation of the formula. I used the formula described in Wikipedia (http://en.wikipedia.org/wiki/Mandelbox). We are programming in C and use the OpenGL library to draw each point which is stored in an array (with x and y value). My current code looks like this: Code: float mandel_array[100][100]; First question: Is it right to do a break if the magnitude is higher than 2? And why? Second problem: After using this function I get points that are "randomly" somewhere in space. Do you normalize the points to a certain range (like -1.0 to +1.0)? Third question: What is this c value in "v = scale*v + c" standing for? I'm really hoping some of you can help me! Thanks a lot! smooo Title: Re: Beginner's problems with the Mandelbox formula Post by: Tglad on January 24, 2011, 12:59:39 AM "Is it right to do a break if the magnitude is higher than 2? And why"
Not right, if scale is negative then the box radius is 2, but you should exit when the magnitude is > 4, to allow for the corners. For scale=2 the box radius is 6. "After using this function I get points that are "randomly" somewhere in space. Do you normalize the points to a certain range (like -1.0 to +1.0)?" You plot the first value of v, not the final one... and should only find inside points between -2,-2,-2 and 2,2,2 in -ve scale. "What is this c value in "v = scale*v + c" standing for?" c is the initial value of v, so there'll be a unique c for each point in your array, but for each point c will not vary during the iterations. Hope that helps smooo Title: Re: Beginner's problems with the Mandelbox formula Post by: cKleinhuis on January 24, 2011, 10:35:24 AM the reason because you leave the iteration loop after the "bailout" is, because after a certain magnitude, the follow up values will always be larger then the one before, so the point "diverges" escape time formulas like the mandelbrot show points that "do not diverge"
regards Title: Re: Beginner's problems with the Mandelbox formula Post by: smooo on January 24, 2011, 11:07:17 PM Thanks very very much for your help!
I did a few changes in my code and now it looks like the image below (scale = 2.0, radius = 6.0). At least a little bit like a Mandelbox. :) (http://i51.tinypic.com/2ngg092.png) (http://i53.tinypic.com/ngr9cw.png) Plus another question: What's exactly the dependency (formula) between scale and radius? If you have any tips for the OpenGL rendering just post it. Right now I'm drawing single gl_points so it still has many holes. ;) smooo Title: Re: Beginner's problems with the Mandelbox formula Post by: Tglad on January 25, 2011, 12:18:38 AM That actually looks about right... only, its a picture of scale -2.
-ve scale all have radius 2, +ve scale have larger radius closer to scale 1, and smaller the larger the scale is. Title: Re: Beginner's problems with the Mandelbox formula Post by: smooo on February 08, 2011, 04:43:13 PM Hey again, finally I wanted to thank you for helping me. :) The last days we went on fixing some bugs and parallelizing the mandelbox calculation in CUDA. Of course you were mentioned in our presentation. ;) Byebye, smooo |