Title: Implementation of 'plane' function? Post by: MarkJayBee on March 04, 2011, 03:42:00 PM Following a recent post of one of my pieces over on dA, DarkBeam (Luca) mentioned
that the 'plane' on which my fractal rested could be possibly added as an additional option in M3D. I'm no coder or mathematician, so I'll just quote a couple of Luca's comments - which are waaaay over my head! "It is absolutely easy do this (plane func) but it will be useless without an option that activate it onlly at a defined iter If you set to zero all xyz that satisfy ax plus by plus bz less than an epsilon you make appear a plane with given inclination". And also: "ask him (Jesse) to implement pre and post transform. When this will be done it will be straightforward to add those things and they will work perfectly, otherwise now it's hard for me and the usage would be not easy". I can see the usefulness of having the option to insert a planar surface at variable angles - and also a facility for colouration - but is it practical? Or is this just wishful thinking?! Here's the params - fully zoomed out - for the fractal in question: Mandelbulb3Dv16{ M.....S....w....w....2.............6.1.......s3E................................ .....................UF92FpyVYzD8QxckpX05z1........Y./..................y.2..... ................/ME//....6Uh....I.....E4.....Qz/NcmCAZtD/.ELEF6E...c./...y1....U z6EnAncD..../.EnAnAnAnAxz0........zD..................................sD...../.. .w1...sDYsAIxzzzjz1..........WAbUdisqcljTcFzUvMS3t97C1JzzzzvzUNehUisqcljMaO9c9iB Ow1mQ0auWPX4zU2bVezzzzyD....U.YS......................sD..kz.................... .............................UJRa4.wpNO.6Obd/.mRa4.irNO.EVbd/UCSa4.............. ................q..........U..6.a....o0...EB....p0...g1....F....8/...IHB...UJF12 ...U.KhcndaF.tJPtQXGPnddw06.0c..GDeM.cVoK/nl2xvjQvM93P58iz1...........U.8.kKKN5. IwUmc2beYz1RdA8E5Exwz0........../6U0.wzzz1................................E.0c.. zzzz.................................2U.8.kzzzD................................. /6U0.wzzz1...................................k5TM0kivuA.zz/k.1A.Ofhq.szDrSfl.gvi C1EzT/sVc0kivuA.it5MUZ5..S6e.2gTU/KS..sVc0k2z/4Mt/.U5W8.bx5MUZ5..S6e.svTU/KS..sV c0E1.CKMh/.U5W8....y3q/.zz/k.1A.yz1yAT2.xzpaqa9................................. E....A....E.....I....E....kLn/5OZ7LNOZaPq/kI371................................. ...................0./........zD........6.2........wz........................... ................................................................................ .....................Uy....3....4....2YEjVbJV7LSHBKMgJ4BY/...................... .Q...2.........................E........Uz1........wz...................kz1..... ................................................................................ ................................/....E/...U0....HZKNm/LOiBrOdB1................. ................4MU/4MU/..................2........wz.........zD........kz1..... ................................................................................ ............................................} Title: Re: Implementation of 'plane' function? Post by: hobold on March 04, 2011, 04:24:07 PM A plane in 3-space can be represented with a linear equation:
a*x + b*y + c*z + d = 0 The vector (a,b,c) is a normal vector of the plane (i.e. it defines orientation) and the parameter d controls how far away that plane is from the coordinate origin. For the purposes of tracing rays, one can either substitute (x,y,z) above with the parametric equation for a ray, and directly solve for the intersection point. Alternatively, you can normalize the plane's equation such that its scalar result for any point in space equals the signed distance from the plane (just scale the normal vector to unit length). Title: Re: Implementation of 'plane' function? Post by: DarkBeam on March 04, 2011, 05:57:47 PM A plane in 3-space can be represented with a linear equation: a*x + b*y + c*z + d = 0 The vector (a,b,c) is a normal vector of the plane (i.e. it defines orientation) and the parameter d controls how far away that plane is from the coordinate origin. For the purposes of tracing rays, one can either substitute (x,y,z) above with the parametric equation for a ray, and directly solve for the intersection point. Alternatively, you can normalize the plane's equation such that its scalar result for any point in space equals the signed distance from the plane (just scale the normal vector to unit length). Yes. It seems very easy at a first approach. But if I write this transform (see the post in DeviantArt, I wrote exactly that) and the transform is iterated and not done once, many planes will be added at every recursion, with weird "orbit-trap" effects... ;D What we need is a code that is exected once only ---> a pre-transform! Title: Re: Implementation of 'plane' function? Post by: tomot on March 04, 2011, 09:22:32 PM It occurs to me this is a good subject for me to attempt some programming.
If I can't grasp, the math for a plane, which is high school stuff, :embarrass: I should simply return my diploma. Regardless I'll be looking for some hand holding, on how to transfer this formula to Mandelbulb 3d :beer: Title: Re: Implementation of 'plane' function? Post by: DarkBeam on March 04, 2011, 09:33:38 PM Why you haven't readed my previous post? :( |