From 710bffe0c8795f5258ed263e247903bef23a5633 Mon Sep 17 00:00:00 2001 From: mclarekin Date: Mon, 30 May 2016 17:40:36 +1200 Subject: [PATCH] Updated MBulb Kali Multi with second trig control --- .../qt_data/fractal_mandelbulb_bermarte.ui | 318 +++++++++--------- .../qt_data/fractal_mandelbulb_kali_multi.ui | 157 ++++++++- mandelbulber2/src/fractal_formulas.cpp | 141 +++++--- 3 files changed, 400 insertions(+), 216 deletions(-) diff --git a/mandelbulber2/qt_data/fractal_mandelbulb_bermarte.ui b/mandelbulber2/qt_data/fractal_mandelbulb_bermarte.ui index 7ad58a391..03a2a91a2 100644 --- a/mandelbulber2/qt_data/fractal_mandelbulb_bermarte.ui +++ b/mandelbulber2/qt_data/fractal_mandelbulb_bermarte.ui @@ -96,43 +96,8 @@ 2 - - - - Phi Scale: - - - - - - - fabs(z.x) - - - - - - - Beta angle offset1: - - - - - - - Qt::Horizontal - - - - - - - Theta Scale: - - - - - + + 0 @@ -140,10 +105,10 @@ - 0 + -18000 - 500 + 18000 0 @@ -156,8 +121,8 @@ - - + + 0 @@ -184,8 +149,33 @@ - - + + + + + 0 + 0 + + + + -18000 + + + 18000 + + + 0 + + + 0 + + + Qt::Horizontal + + + + + 0 @@ -212,63 +202,92 @@ - - - - Qt::Horizontal + + + + Rotate about z axis : - - + + - fabs(z.y) + fabs(z.x) - - - - Qt::Horizontal + + + + Bulb Power: - - + + - + 0 0 - - + + -500 - - + + 500 - - 2 + + 0 + + + 0 + + + Qt::Horizontal + + + + + + + + 0 + 0 + - -36000.000000000000000 + 0 - 36000.000000000000000 + 500 - - 0.100000000000000 + + 0 + + + 0 + + + Qt::Horizontal - - + + - Beta angle offset2: + Beta angle offset1: + + + + + + + Enable cos-tan mode (disable sin-tan2 mode) - + @@ -296,26 +315,35 @@ - - + + - + 0 0 + + + + + + + + 2 + + + -36000.000000000000000 + - 2000 + 36000.000000000000000 - 1 - - - Qt::Horizontal + 0.100000000000000 - + @@ -343,32 +371,7 @@ - - - - - 0 - 0 - - - - -500 - - - 500 - - - 0 - - - 0 - - - Qt::Horizontal - - - - + @@ -406,39 +409,61 @@ - - + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + - Bulb Power: + Beta angle offset2: - - + + + + fabs(z.y) + + + + + + + Qt::Horizontal + + + + + 0 0 - - -18000 - - 18000 - - - 0 + 2000 - - 0 + + 1 Qt::Horizontal - + @@ -463,8 +488,15 @@ - - + + + + Theta Scale: + + + + + 0 @@ -491,46 +523,14 @@ - - - - - 0 - 0 - - - - -18000 - - - 18000 - - - 0 - - - 0 - - - Qt::Horizontal - - - - - - - Rotate about z axis : - - - - - + + - Enable cos-tan mode (disable sin-tan2 mode) + Phi Scale: - + Enable cos-tan mode (disable sin-tan2 mode) diff --git a/mandelbulber2/qt_data/fractal_mandelbulb_kali_multi.ui b/mandelbulber2/qt_data/fractal_mandelbulb_kali_multi.ui index e3e0f5dc8..2b3a9284c 100644 --- a/mandelbulber2/qt_data/fractal_mandelbulb_kali_multi.ui +++ b/mandelbulber2/qt_data/fractal_mandelbulb_kali_multi.ui @@ -37,7 +37,7 @@ false - + 2 @@ -521,6 +521,13 @@ + + + + Qt::Horizontal + + + @@ -574,8 +581,8 @@ - - + + Qt::Horizontal @@ -595,11 +602,140 @@ - - - - Qt::Horizontal + + + + <html><head/><body><p>Cpixel is CVector3 c = ( c.x, c.y, c.z). It is each original point (pixel) in 3D space where the iteration starts from, ( c = original z for each point .) It is commonly found in formula structures z = f(z) + c.</p><p>The Cpixel multiplier effectively scales this point &quot;c&quot;.</p><p>This transform allows the swapping of the order of the &quot;CVector3 c&quot; components before being multiplied by &quot;CVector3 z&quot; components.</p></body></html> + + + Enable seperate trig& control of second function + + true + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + 2 + + + + + 5 + + + + + + xyz + + + + + xzy + + + + + yxz + + + + + yzx + + + + + zxy + + + + + zyx + + + + + + + + + acos + + + + + asin + + + + + + + + function order of x, y and z: + + + Qt::AlignCenter + + + + + + + + atan + + + + + atan2 + + + + + + + + th0 function2: + + + Qt::AlignCenter + + + + + + + ph0 function2: + + + Qt::AlignCenter + + + + + + + + @@ -611,13 +747,6 @@ - - - - 5 - - - diff --git a/mandelbulber2/src/fractal_formulas.cpp b/mandelbulber2/src/fractal_formulas.cpp index 1d2967639..68b944890 100644 --- a/mandelbulber2/src/fractal_formulas.cpp +++ b/mandelbulber2/src/fractal_formulas.cpp @@ -1317,9 +1317,6 @@ void CollatzModIteration(CVector3 &z, CVector3 &c, const cFractal *fractal, sExt } } - - - /** * Modified Mandelbox (ABox) formula */ @@ -1903,51 +1900,108 @@ void MandelbulbKaliMultiIteration(CVector3 &z, CVector3 &c, const cFractal *frac costh = cos(th0); z = aux.r * CVector3(costh * sin(ph0), cos(ph0) * costh, sin(th0)); } - switch (fractal->mandelbulbMulti.orderOfxyz) + + if (fractal->transformCommon.functionEnabledxFalse) { + switch (fractal->mandelbulbMulti.orderOfxyz2) + { - case sFractalMandelbulbMulti::xyz: - default: - v1 = z.x; - v2 = z.y; - v3 = z.z; - break; - case sFractalMandelbulbMulti::xzy: - v1 = z.x; - v2 = z.z; - v3 = z.y; - break; - case sFractalMandelbulbMulti::yxz: - v1 = z.y; - v2 = z.x; - v3 = z.z; - break; - case sFractalMandelbulbMulti::yzx: - v1 = z.y; - v2 = z.z; - v3 = z.x; - break; - case sFractalMandelbulbMulti::zxy: - v1 = z.z; - v2 = z.x; - v3 = z.y; - break; - case sFractalMandelbulbMulti::zyx: - v1 = z.z; - v2 = z.y; - v3 = z.x; - break; - } + case sFractalMandelbulbMulti::xyz: + default: + v1 = z.x; + v2 = z.y; + v3 = z.z; + break; + case sFractalMandelbulbMulti::xzy: + v1 = z.x; + v2 = z.z; + v3 = z.y; + break; + case sFractalMandelbulbMulti::yxz: + v1 = z.y; + v2 = z.x; + v3 = z.z; + break; + case sFractalMandelbulbMulti::yzx: + v1 = z.y; + v2 = z.z; + v3 = z.x; + break; + case sFractalMandelbulbMulti::zxy: + v1 = z.z; + v2 = z.x; + v3 = z.y; + break; + case sFractalMandelbulbMulti::zyx: + v1 = z.z; + v2 = z.y; + v3 = z.x; + break; + } + if (fractal->mandelbulbMulti.acosOrasinA == sFractalMandelbulbMulti::acos) + th0 = acos(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; + else + th0 += asin(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; - if (fractal->mandelbulbMulti.acosOrasin == sFractalMandelbulbMulti::acos) - th0 = acos(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; + if (fractal->mandelbulbMulti.atanOratan2A == sFractalMandelbulbMulti::atan) + ph0 += atan(v2 / v3); + else + ph0 += atan2(v2, v3); + } else - th0 += asin(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; + { + switch (fractal->mandelbulbMulti.orderOfxyz) + { + + case sFractalMandelbulbMulti::xyz: + default: + v1 = z.x; + v2 = z.y; + v3 = z.z; + break; + case sFractalMandelbulbMulti::xzy: + v1 = z.x; + v2 = z.z; + v3 = z.y; + break; + case sFractalMandelbulbMulti::yxz: + v1 = z.y; + v2 = z.x; + v3 = z.z; + break; + case sFractalMandelbulbMulti::yzx: + v1 = z.y; + v2 = z.z; + v3 = z.x; + break; + case sFractalMandelbulbMulti::zxy: + v1 = z.z; + v2 = z.x; + v3 = z.y; + break; + case sFractalMandelbulbMulti::zyx: + v1 = z.z; + v2 = z.y; + v3 = z.x; + break; + } + + + if (fractal->mandelbulbMulti.acosOrasin == sFractalMandelbulbMulti::acos) + th0 = acos(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; + else + th0 += asin(v1 / aux.r) + fractal->transformCommon.betaAngleOffset + 1e-061; + + if (fractal->mandelbulbMulti.atanOratan2 == sFractalMandelbulbMulti::atan) + ph0 += atan(v2 / v3); + else + ph0 += atan2(v2, v3); + + } + + + - if (fractal->mandelbulbMulti.atanOratan2 == sFractalMandelbulbMulti::atan) - ph0 += atan(v2 / v3); - else - ph0 += atan2(v2, v3); ph0 *= fractal->transformCommon.pwr8 * fractal->transformCommon.scaleB1 * 0.5;// 0.5 retain double zp = pow(aux.r, fractal->transformCommon.pwr8); @@ -1962,6 +2016,7 @@ void MandelbulbKaliMultiIteration(CVector3 &z, CVector3 &c, const cFractal *frac costh = cos(th0); z = zp * CVector3(costh * sin(ph0), cos(ph0) * costh, sin(th0)); } + if (fractal->transformCommon.functionEnabledyFalse) { aux.r_dz = pow( aux.r, fractal->transformCommon.pwr8 - 1.0) * fractal->transformCommon.pwr8