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: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 05:52:20 AM


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: simple code for mandelbox  (Read 8280 times)
0 Members and 1 Guest are viewing this topic.
Owl
Guest
« on: July 02, 2012, 09:02:11 AM »

hello,
i'm new here and like few others i understand code better than math formulas smiley
i'm trying to generate mandelbox in houdini(www.sidefx.com) but i'm stuck, i've made mandelbulb which if i get it correctly, looks like this:


and on code looks like:

Code:
p0[xyz] = p[xyz]      //point position
n = 8       // power
itter = 15 // number of iterations

for (i=0, i<itter, i++){
 p[xyz] => sp[r theta phi]  // to spherical
 r= pow(r, n)
 theta = theta * 8
 phi = phi * 8
 sp[r theta phi] => p[xyz] // back to cartesian
 p[xyz] = p[xyz] + p0[xyz]
}

i'm using original sample position as c which seems to give correct results, am i right?

And, i think, i get folding too.
(this one is from wiki)
Code:
function iterate(z):
    for each component in z:
        if component > 1:
            component := 2 - component
        else if component < -1:
            component := -2 - component

    if magnitude of z < 0.5:
        z := z * 4
    else if magnitude of z < 1:
        z := z / (magnitude of z)^2
   
    z := scale * z + c


what i don't get, is how to put it together? mandelbox is mandelbrot folded into a box, right?

they both have loops/iterations should i do mandelbulb and then fold it?
or is it one step of folding + step mandelbulb? (i think i've tried it too)

I've found lots of examples and snippets of code, but it still doesn't work Sceptical i'm probably missing something obvious.

P.S. If anyone is interested in houdini version of mandelbulb i'm attaching the file
and will defenately do so with mandelbox after i get it smiley

* mandelbulb.rar (21.76 KB - downloaded 238 times.)
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #1 on: July 02, 2012, 10:09:18 AM »

Look nice, your rendering. How fast is it to render an image like that? Using a raytracer such as Houdini, without any DE optimization must be very slow, right?

i'm using original sample position as c which seems to give correct results, am i right?

Yes. You can also use a fixed constant, which will give you a JuliaBox / JuliaBulb.

Wrt to the Mandelbox: It is not directly related to the Mandelbulb, and you shouldn't mix code. The formula you wrote should be all you need: iterate the function, and check if the magnitude of z becomes larger than some threshold. Use scale=2 for testing.
Logged
Owl
Guest
« Reply #2 on: July 02, 2012, 10:36:48 AM »

thanks, for a quick reply

well i'm using volumes so generation of the bulb takes ~ 1 min 500x500x500 voxel container so its 500^3 samples per iteration
and rendering 29 sec.

just to clarify - houdini is a 3d software, i use mantra (render engine in houdini), this render is done with micro polygons and shadow maps, thou i could try to ray trace it eventually smiley
(they have a free non-commercial version if someone is interested)

will, come back with results smiley
Logged
KRAFTWERK
Global Moderator
Fractal Senior
******
Posts: 1439


Virtual Surreality


WWW
« Reply #3 on: July 02, 2012, 11:20:43 AM »

WOW, I love the fury look of your bulb... Might try out houdini some day...
Logged

Owl
Guest
« Reply #4 on: July 02, 2012, 12:04:11 PM »

and it works! (dont know what i did wrong the firs time, but now it ok smiley

its a lot noisier than mandelbulb... now its probably time to look for optimization posibilities, but since its not a ray cast, i'm not sure whether same methods apply.

its furry because its a volume like a cloud, so it looks softier smiley

and a scene file as promised wink

* mandelbox.rar (22.14 KB - downloaded 257 times.)
Logged
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #5 on: July 05, 2012, 04:04:24 PM »

fluffy \o/  grin

i really really like houdini, it's an awesome software.
I only have the "apprentice" edition. Houdini being, afaik, the most expensive 3D software ever smiley
Do you know if i can do that using the Apprentice edition ?
thank you
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
Owl
Guest
« Reply #6 on: July 06, 2012, 10:50:36 AM »

fluffy \o/  grin

i really really like houdini, it's an awesome software.
I only have the "apprentice" edition. Houdini being, afaik, the most expensive 3D software ever smiley
Do you know if i can do that using the Apprentice edition ?
thank you

It is expensive and it offers so much cheesy
Yes sure you can, you can take my sceene an start with it, i've moved it to cvex (render time calculation smiley ) so look for it in SHOP context
Haven't done colors yet, how do you calculate them? based a ramp values based on a resulting vector magnitude?

anyway here's the scene, otl, and a new image smiley
Full ray trace, 11 min 27 sec


somehow i can't upload hip file, so i'm putting it online and just dropping a link smiley
http://www64.zippyshare.com/v/85035747/file.html

 
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #7 on: July 06, 2012, 11:27:26 AM »

Looks great, but I can't understand the rounded corners - I don't think they are a consequence of the volumetric rendering.

Do you have some kind of escape conditions (like: if (length(z)>10.0) break;)? You might want to raise the bailout value a bit (to at least 10.0).
 

Logged
Owl
Guest
« Reply #8 on: July 17, 2012, 09:39:23 AM »

probably the scale was to big i had a container of 6x6x6
here is a 4x4x4
<a href="https://vimeo.com/moogaloop.swf?clip_id=45886560&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" target="_blank">https://vimeo.com/moogaloop.swf?clip_id=45886560&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA</a>
Logged
zephmann
Guest
« Reply #9 on: September 06, 2012, 06:28:14 PM »

Cool stuff!

Here is a link to a similar thread over at odforce about creating Mandelbulbs in Houdini, including some scene files from Jeff Lait, who is one of the senior mathematicians at Side Effects.

http://forums.odforce.net/index.php?/topic/10207-3d-mandelbrot-primitive/
Logged
faxingberlin
Forums Newbie
*
Posts: 2


« Reply #10 on: July 28, 2016, 12:57:34 PM »

It is expensive and it offers so much cheesy
Yes sure you can, you can take my sceene an start with it, i've moved it to cvex (render time calculation smiley ) so look for it in SHOP context
Haven't done colors yet, how do you calculate them? based a ramp values based on a resulting vector magnitude?

anyway here's the scene, otl, and a new image smiley
Full ray trace, 11 min 27 sec
<Quoted Image Removed>

somehow i can't upload hip file, so i'm putting it online and just dropping a link smiley
http://www64.zippyshare.com/v/85035747/file.html

 

Looks really awesome!

i can't access uploaded hip file (http://www64.zippyshare.com/v/85035747/file.html)

Could you upload again?
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Simple 2D IFS animation Movies Showcase (Rate My Movie) David Makin 0 1915 Last post December 09, 2006, 11:41:48 PM
by David Makin
I arrive, and I come with code. Meet & Greet CraigM 3 1583 Last post January 16, 2009, 12:13:07 PM
by Cyclops
Simple 3D IFS in POV-Ray IFS - Iterated Function Systems utak3r 1 7825 Last post March 19, 2010, 08:16:44 AM
by Nahee_Enterprises
some code Mandelbulb 3d Jesse 7 2981 Last post August 15, 2011, 10:27:15 PM
by Jesse
Mandelbox 2D questions and code attempt Programming asimes 11 4969 Last post April 27, 2012, 09:28:49 AM
by DarkBeam

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.134 seconds with 24 queries. (Pretty URLs adds 0.006s, 2q)