DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #75 on: November 12, 2016, 08:59:06 AM » |
|
But isn't Tglad fold exactly the Mandelbox fold? Doh Aldo rotate back should only ripristinate coords multiplying by the same rot matrix as before but translated (switch rows with columns). This is a nice framework for mostly every transformer imaginable though 🤓
|
|
« Last Edit: November 12, 2016, 09:24:25 AM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
3dickulus
|
|
« Reply #76 on: November 12, 2016, 06:18:12 PM » |
|
@mclarekin me thinks FragM needs a mclarekin folder in the /Examples/
|
|
|
Logged
|
|
|
|
|
mclarekin
|
|
« Reply #78 on: November 13, 2016, 01:06:15 AM » |
|
@darkbeam I am not really sure but I thought that Tglad fold was the same as Mbox at default setting and when the Mbox limit:value ratio was at 1:2. But when straying from this ratio (when using the MboxFold in an Mbox formula) I think can cause nasty cuts therefore 99% of the time Tglads fold is the easiest one to use. I thought, "ripristinate! is that a typo?" but it is a real word . Yeah, i assumed that was the correct way the transform should work, and had only added in the second rotation controls as a checkBox option. Then I decided to delay figuring out if I could do a non-trig back rotation. When I have time I may test adding this fold (from M3D somewhere?), to the UI :- z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold)
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #79 on: November 13, 2016, 02:12:46 AM » |
|
I like these patterned surfaces that come out of mixing all these IFS foldings as per attached image (there are still areas of menger sponge inside as well.) So now that I have Folding Tetra3D, Octo, Menger and all this Cross Menger code, I can explore a lot more possibilities, and they are FAST to render. (and there is Knighty's KIFS UI in Mandelbulber that can do much more if you learn how to use it.) One of FRagmentariums advantages is in being able to have all these in a .frag for exploring , and when you find a good place, just simply //comment out the transforms you have decided not to use. I currently have a UI setup in this order : - PrismShape Rotation CMT CMkifs Benesi T1 Benesi T1mod (a Tglad fold inside) FabsMulti Menger Sponge there is more rotations and other transforms to be added, but it already too big and clumsy .
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #80 on: November 13, 2016, 02:27:27 AM » |
|
Attached image show what the Benesi t1Mod and the Fabs Multi transforms on the UI.
Fabs Multi lets me explore various fabs() folds, but with the cost of the extra checkBoxes and maths.
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #81 on: November 13, 2016, 02:39:35 AM » |
|
@crist. Cool, checking out the dot modes.
For prismShape2 I have added two more offset options. This allows me to replicate the variations I had between earlier versions.
t = max(0.0, dot1); if (fractal->transformCommon.functionEnabledBxFalse) { z.x -= t * -SQRT_3 - (fractal->transformCommon.offset0); } else { z.x -= t * -SQRT_3; } z.y = fabs(z.y - t); if (z.y > z.z) { temp = z.y; z.y = z.z; z.z = temp; } if (fractal->transformCommon.functionEnabledByFalse) z.y -= fractal->transformCommon.offset105;
z -= gap * CVector3(SQRT_3_4, 1.5, 1.5);
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #82 on: November 13, 2016, 02:44:13 PM » |
|
mclarekin, i'm newbie in programming, more interested in fractal rendering ) So i really don't understand your code This formula z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold) What is fold and fold2?
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #83 on: November 14, 2016, 01:39:12 AM » |
|
@crist These questions should be directed to Darkbeam. But I will try to answer This function contains two folds. Fold & fold2 are user defined variable parameters, usually a double or vect3. This is the mapping or maths sequence where fold & fold2 can be pos or neg numbers x' = fold2 - fabs( fabs(x + fold) - fold2) - fabs(fold) broken into steps: result' = (x + fold); shift x by distance fold result' = fabs(result); fold the result, (fold the plane, all neg numbers are mapped over to positive) result' = ( result - fold2); shift the result by distance fold2 result' = fabs(result); again all negative numbers are folded to positive x' = fold2 - result - fabs(fold); final shifts. fold is the number used to "shift / offset / translate / add_additionConstant" before doing the "absolute function" So I was thinking of trialling this in between a rotate_forward and a rotate_back. I think I already have included it as an amazing_surf fold option (it could be added to Tim Emit's amazing surf frag set up.)
|
|
« Last Edit: November 14, 2016, 01:50:09 AM by mclarekin, Reason: attempt at clarifcation. »
|
Logged
|
|
|
|
Sabine
|
|
« Reply #84 on: November 16, 2016, 11:36:26 AM » |
|
Please ignore, answered the wrong thread, my bad! Seems the topic was split while I was typing :}
|
|
« Last Edit: November 16, 2016, 11:47:52 AM by Sabine62 »
|
Logged
|
sabine62.deviantart.com
|
|
|
mclarekin
|
|
« Reply #85 on: November 30, 2016, 12:22:49 PM » |
|
I have just tried this Iteration Weight Transform with the prismShapeCMT, and it works well, ( as it does with menger sponge,, and sometimes with other fractals, but I have :hmh:forgotten). The function occasionally can improve the DE quality I generally put it as the last transform in a loop
// iteration weight transform. // Influence fractal based on the weight of Z values at specified iterations // intA & intB are positive int, (0,0,99) // vec3 offsetIw1 & 2 slider (-5,0,5) // float scaleIw guessing slider (0,1,3)
if (iterW) { vec3 zA, zB;
if (i == intA) { zA = z; } if (i == intB) { zB = z; } z = (z * scaleIw) + (zA * offsetIw1) + (zB * offsetIw2); Dd *= scaleIw; //aux.r_dz *= scaleIw; }
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #86 on: December 21, 2016, 10:44:56 AM » |
|
I have been testing the DotModes in the PrismShape. There is some good things hidden in the combinations. Having the seperate bool abs functions allows for more combinations (not all prismshape). DE can get a bit bad with some. These are the six DotModes I have tested . My loop was PrismShape, Octo, SphereFold, Rotation, Menger if(FabsXMode == 1) z.x = fabs(z.x);
if(FabsYMode == 1) z.y = fabs(z.y);
if(FabsZMode == 1) z.z = fabs(z.z);
if(DotMode==0) { float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.x -= t * -SQRT_3; z.y = fabs(z.y - t); } if(DotMode==1) { float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.y -= t * -SQRT_3; z.x = fabs(z.x - t); // x y swap }
if(DotMode==2) { float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.z -= t * -SQRT_3; z.y = fabs(z.y - t); // z.z z.y swap } if(DotMode==3) { float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.y -= t * -SQRT_3; z.z = fabs(z.z - t); // z.z z.y swap } if(DotMode==4) { float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.zy -= t * -SQRT_3; z.xy = fabs(z.yx - t); //x y swap and other things }
if(DotMode==5) { float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP; float t = max(0.0, dot1); z.xy -= t * -SQRT_3; z.yz = fabs(z.yz - t); //x y swap and other things }
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #87 on: January 07, 2017, 09:33:51 AM » |
|
Finally finished PrismShape2. Attached hybrid image is CMT (3 iters) Mbox (the rest) /** * Menger Prism Shape2 * from code by Knighty * http://www.fractalforums.com/fragmentarium/ * cross-menger!-can-anyone-do-this/msg93972/#new */ void MengerPrismShape2Iteration(CVector3 &z, int i, const cFractal *fractal, sExtendedAux &aux) { CVector3 gap = fractal->transformCommon.constantMultiplier000; double t; double dot1; if (fractal->transformCommon.functionEnabledSwFalse) { z = CVector3{-z.z, z.x, z.y}; } if (fractal->transformCommon.functionEnabledx && i >= fractal->transformCommon.startIterationsP && i < fractal->transformCommon.stopIterationsP1) { if (fractal->transformCommon.functionEnabledCxFalse) { z.x = fabs(z.x); } if (fractal->transformCommon.functionEnabledCy) { z.y = fabs(z.y); } if (fractal->transformCommon.functionEnabledCz) { z.z = fabs(z.z); } double tempOff = (fractal->transformCommon.offset0 + SQRT_3_4d2); switch (fractal->combo.modeA) { case sFractalCombo::mode0: default: dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.x -= t * -SQRT_3 - tempOff; z.y = fabs(z.y - t); break; case sFractalCombo::mode1: dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.y -= t * -SQRT_3 - tempOff; z.x = fabs(z.x - t); // x y swap break; case sFractalCombo::mode2: dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.z -= t * -SQRT_3 - tempOff; z.y = fabs(z.y - t); // z y swap break; case sFractalCombo::mode3: dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.y -= t * -SQRT_3 - tempOff; z.z = fabs(z.z - t); // z y swap break; case sFractalCombo::mode4: dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.y -= t * -SQRT_3 - tempOff; z.z -= t * -SQRT_3 - tempOff; z.x = fabs(z.x - t); // x y swap and other things z.y = fabs(z.y - t); break; case sFractalCombo::mode5: dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.x -= t * -SQRT_3 - tempOff; z.y -= t * -SQRT_3 - tempOff; z.y = fabs(z.y - t); // x y swap and other things z.z = fabs(z.z - t); break; case sFractalCombo::mode6: dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.y -= t * -SQRT_3 - (fractal->transformCommon.offset0); z.z -= t * -SQRT_3 - (fractal->transformCommon.offset0); z.x = fabs(z.y - t); // x y swap and other things and swizzle z.y = fabs(z.x - t); break; case sFractalCombo::mode7: dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale; t = max(0.0, dot1); z.x -= t * -SQRT_3 - (fractal->transformCommon.offset0); z.y -= t * -SQRT_3 - (fractal->transformCommon.offset0); z.y = fabs(z.z - t); // x y swap and other things and swizzle z.z = fabs(z.y - t); break; }
if (z.y > z.z) swap(z.y, z.z); z.y -= fractal->transformCommon.offsetB0;
z -= gap * CVector3(SQRT_3_4, 1.5, 1.5);
if (z.z > z.x) swap(z.z, z.x);
if (fractal->transformCommon.functionEnabledyFalse) { z.y = max(0.0, z.y) * fractal->transformCommon.scaleA1; z.z = max(0.0, z.z) * fractal->transformCommon.scaleB1; } if (fractal->transformCommon.functionEnabledzFalse) { if (z.x >= 0.0) { z.y = max(0.0, z.y) * fractal->transformCommon.scaleA1; z.z = max(0.0, z.z) * fractal->transformCommon.scaleB1; } } z *= fractal->transformCommon.scale1; aux.DE *= fractal->transformCommon.scale1; aux.DE *= fractal->transformCommon.scaleC1; }
if (fractal->transformCommon.functionEnabledXFalse && i >= fractal->transformCommon.startIterationsA && i < fractal->transformCommon.stopIterationsA) { // CrossMengerTrick double dd = aux.DE; z.y = fabs(z.y); z.z = fabs(z.z); if (fractal->transformCommon.functionEnabledCyFalse) { z.x = fabs(z.x); } dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scaleD1; double t = max(0.0, dot1); z.x -= t * -SQRT_3; if (fractal->transformCommon.functionEnabledBzFalse) { z.y = fabs(z.y) - t; } else { z.y = fabs(z.y - t); } z.x -= SQRT_3_4; double dy = 0.0; double dz = 0.0; if (z.y > 0.5 && z.z > 0.5) { dy = 1.5; dz = 1.5; } else if ((z.y - 1.5) * (z.y - 1.5) + z.z * z.z < z.y * z.y + (z.z - 1.5) * (z.z - 1.5)) { dy = 1.5; } else dz = 1.5;
z.y -= dy; z.z -= dz; z *= fractal->transformCommon.scaleA3; aux.DE *= fractal->transformCommon.scaleA3; z.y += dy; z.z += dz; z.x += SQRT_3_4;
if (fractal->transformCommon.functionEnabledFalse) { dd *= 0.33333333333333333333333333333 * fractal->transformCommon.scaleE1; z *= dd; aux.DE *= dd; } aux.DE *= fractal->transformCommon.offset1; //.DE tweak cross menger trick part } if (fractal->transformCommon.functionEnabledPFalse) { z.x = fabs(z.x + fractal->transformCommon.offset) + fractal->transformCommon.offsetC0; }
// void KIFS(vec3 z) //{//Pure KIFS... almost correct
if (fractal->transformCommon.functionEnabledKFalse && i >= fractal->transformCommon.startIterationsB && i < fractal->transformCommon.stopIterationsB) { if (fractal->transformCommon.functionEnabledCzFalse) { z.x = fabs(fractal->transformCommon.offset - z.x ) + fractal->transformCommon.offsetC0; }
z.y = fabs(z.y); z.z = fabs(z.z);
double dot2 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scaleF1; double t = max(0.0, dot2);
z.x -= t * -SQRT_3; z.y = fabs(z.y - t);
if (z.y > z.z) swap(z.y, z.z);
z.y = fabs(z.y - 0.5) + 0.5;
z -= CVector3(0.5 * SQRT_3, 1.5, 1.5);
z *= fractal->transformCommon.scaleB3; aux.DE *= fractal->transformCommon.scaleB3;
z += CVector3(0.5 * SQRT_3, 1.5, 1.5); }
|
|
|
Logged
|
|
|
|
Sabine
|
|
« Reply #88 on: January 07, 2017, 07:40:12 PM » |
|
Congratulations, mclarekin!
|
|
|
Logged
|
sabine62.deviantart.com
|
|
|
Tim Emit
|
|
« Reply #89 on: January 09, 2017, 07:41:44 PM » |
|
excellent
|
|
|
Logged
|
|
|
|
|