mclarekin
|
|
« Reply #30 on: July 13, 2016, 12:15:50 PM » |
|
Thanks Knighty for the settings. DarkBeam sidetracked me away from this, with a single line transform _inv_cylindrical. Instead of it being a quick diversion, it turned into yet another journey of discovery I have been thinking about kifs and linear type folds in general, and now can visualize the mega UI that I will probably never build. When I was still using MandelbulberV1.21 openCL, I did a little bit of drawing up and it makes it easier to visualize. This reminded me to have another look at that code
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #31 on: August 18, 2016, 02:48:36 PM » |
|
I have got "some sort" of pseudo kleinian code working with the prism shape and menger sponge in dev V2.09. Early days yet.
|
|
|
Logged
|
|
|
|
M Benesi
|
|
« Reply #32 on: August 19, 2016, 02:50:02 AM » |
|
lol
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #33 on: August 31, 2016, 06:30:06 AM » |
|
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #34 on: August 31, 2016, 06:32:19 AM » |
|
Spring thaw, very nice, refreshing and crispy
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #35 on: August 31, 2016, 09:08:14 AM » |
|
Thank you very much Originally it was this, then moved camera top and looked at water only ) and change sphere to fractal
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #36 on: September 09, 2016, 10:44:54 AM » |
|
I added the pure kifs version in mb3d 8D
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
mclarekin
|
|
« Reply #37 on: September 15, 2016, 12:58:56 PM » |
|
A modification thing.
|
|
|
Logged
|
|
|
|
|
mclarekin
|
|
« Reply #39 on: September 16, 2016, 06:51:42 AM » |
|
This is an attempt at the formula part of a .frag. (I don't know enough yet about programming for fragmentarium) If you can get it to work, please post back the corrected .frag so i can see my mistakes. I have been using it to make hybrids with aSurf, pseudoKlienianMod, and MengerMods This image is with gap.y set at 1.99, the rest of parameters at default. #info CrossMengerMod1 #include "DE-Raytracer.frag" #group CrossMenger
// Number of fractal iterations. uniform float Scale; slider[0.,1.,2.] uniform float ScaleY; slider[0.,1.,2.] uniform float ScaleZ; slider[0.,1.,2.] uniform int iter; slider[0, 12, 250} uniform float3 gap; slider[(-1.,-1.,-1.),(0.,0.,0.),(3.,2.,3.] gap = offset scale, uniform bool Mod; checkbox[false] // this works only with some settings
const float SQRT_3_4 = 0.86602540378443864676372317075294; const float SQRT_3 = 1.73205080756887729352744634150587; float t; float temp; float dot1; const float DE = 1.0; const float Bailout = 10.0; vec3 z = p;
uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)] uniform float RotAngle; slider[0.00,0,180] mat3 rot; void init() { rot = rotationMatrix3(normalize(RotVector), RotAngle); }
void CrossMengerMod1( vec3 z) { z.z = abs(z.z); dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * Scale; t = max(0.0, dot1); z.x -= t * -SQRT_3 - (0.5 * SQRT_3_4); z.y = abs(z.y - t);
if (z.y > z.z) { temp = z.y; z.y = z.z; z.z = temp; } z.y -= 1.5; z -= gap * vec3(SQRT_3_4, -1.5, 1.5);
if (z.z > z.x) { temp = z.z; z.z = z.x; z.x = temp; } if(Mod) { if (z.x >= 0.0) { z.y = max(0.0, z.y) * ScaleY; z.z = max(0.0, z.z) * ScaleZ; } z *= rot; }
for(int i=0; i< iter; i++) { // CrossMengerTrick z.y = abs(z.y); z.z = abs(z.z); dot1 = (z.x * -SQRT_3_4 + z.y * 0.5); float t = 1 * max(0.0, dot1); z.x -= t * -SQRT_3; z.x -= SQRT_3_4;
float dy = 0.0; float 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 *= 3.0; DE *= 3.0; z.y += dy; z.z += dz;
z.x += SQRT_3_4;
r = length(z); if ( r > Bailout) return ( r - 2.) / DE; } }
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #40 on: September 17, 2016, 08:59:06 PM » |
|
Thank you! I tried to make this code working... so here some strange it shows little different geometry ) but it runs #info CrossMengerMod1 #include "MathUtils.frag" #include "DE-Raytracer.frag" #group CrossMenger
// Number of fractal iterations. uniform float Scale; slider[0.,1.,2.] uniform float ScaleY; slider[0.,1.,2.] uniform float ScaleZ; slider[0.,1.,2.]
uniform int Iter; slider[0,12,250]
uniform vec3 gap; slider[(-1.,-1.,-1.),(0.,0.,0.),(3.,2.,3.)] uniform bool Mod; checkbox[false]
const float SQRT_3_4 = 0.86602540378443864676372317075294; const float SQRT_3 = 1.73205080756887729352744634150587; float t; float temp; float dot1; //const float DE = 1.0; const float Bailout = 10.0; //vec3 z = p;
uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)] uniform float RotAngle; slider[0.0,0,180] mat3 rot;
float DE(vec3 z) { rot = rotationMatrix3(normalize(RotVector), RotAngle); z.z = abs(z.z); dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * Scale; t = max(0.0, dot1); z.x -= t * -SQRT_3 - (0.5 * SQRT_3_4); z.y = abs(z.y - t); if (z.y > z.z) { temp = z.y; z.y = z.z; z.z = temp; }
z.y -= 1.5; z -= gap * vec3(SQRT_3_4, -1.5, 1.5); if (z.z > z.x) { temp = z.z; z.z = z.x; z.x = temp; } if(Mod) { if (z.x >= 0.0) { z.y = max(0.0, z.y) * ScaleY; z.z = max(0.0, z.z) * ScaleZ; } z *= rot; }
for(int i=0; i< Iter; i++) { // CrossMengerTrick z.y = abs(z.y); z.z = abs(z.z); dot1 = (z.x * -SQRT_3_4 + z.y * 0.5); float t = 1. * max(0.0, dot1); z.x -= t * -SQRT_3; z.x -= SQRT_3_4; float dy = 0.0; float 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 *= 3.0; float DE1=1.0; DE1*= 3.0; z.y += dy; z.z += dz; z.x += SQRT_3_4; z = length(z); //if (z > Bailout) return ( z- 2.) / DE1; }
}
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #41 on: September 18, 2016, 02:06:38 AM » |
|
Thanks, I now have a better understanding of .frag.
I will code it up in Mandelbulber V1.21 OpenCL and see what I get and report back.
The important bit is the first half , which gives you control over the prism shape, you can replace the crossmengertrick with iterations of other linear types
|
|
|
Logged
|
|
|
|
Tim Emit
|
|
« Reply #42 on: September 19, 2016, 10:36:20 AM » |
|
@crist.. that code runs ok as far as shapes but it doesn't seem to iterate or make much interesting forms...or is that just me !
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #43 on: September 19, 2016, 06:15:59 PM » |
|
The important bit is the first half , which gives you control over the prism shape, you can replace the crossmengertrick with iterations of other linear types
Unfortunately I can't. Not yet I think because all GLSL-guru escaped and maybe soon I will be able to understand this interesting process: imagine - create a mathematical model - implement the code Tim my code is wrong (but runs without errors) Somebody (Knighty, where are you? ) can help.
|
|
|
Logged
|
|
|
|
mclarekin
|
|
« Reply #44 on: September 20, 2016, 09:40:58 AM » |
|
The formula can make the attached image, (but there is an extra bit on the far end I have lost the symmetry). More work required!
|
|
|
Logged
|
|
|
|
|