Logo by Fiery - 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. April 25, 2024, 09:42:13 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: DE Formula for Quaternion + folding  (Read 1543 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: July 11, 2015, 10:06:03 PM »

I played a bit with the original quaternion adding iteration rotation, box fold and sphere fold.
The question I have is regarding the accuracy of DE formula in this case.

If the 'original' quaternion looked as follows:
Code:
float DE(vec3 pos) {
vec4 p = vec4(pos, 0.0);
vec4 dp = vec4(1.0, 0.0,0.0,0.0);

for (int i = 0; i < Iterations; i++) {
dp = 2.0* vec4(p.x*dp.x-dot(p.yzw, dp.yzw), p.x*dp.yzw+dp.x*p.yzw+cross(p.yzw, dp.yzw));
p = vec4(p.x*p.x-dot(p.yzw, p.yzw), vec3(2.0*p.x*p.yzw)) + C;

float p2 = dot(p,p);
orbitTrap = min(orbitTrap, abs(vec4(p.xyz,p2)));
if (p2 > Threshold) break;
}
float r = length(p);
return  0.5 * r * log(r) / length(dp);
}


And roughly we wanted to tweak as follows:

Code:
float DE(vec3 pos) {
vec4 p = vec4(pos, 0.0);
vec4 dp = vec4(1.0, 0.0,0.0,0.0);

for (int i = 0; i < Iterations; i++) {
dp = 2.0* vec4(p.x*dp.x-dot(p.yzw, dp.yzw), p.x*dp.yzw+dp.x*p.yzw+cross(p.yzw, dp.yzw));
p = vec4(p.x*p.x-dot(p.yzw, p.yzw), vec3(2.0*p.x*p.yzw)) + C;

====> roatate(p);
====> boxfold(p);
====> spherefold(p);

float p2 = dot(p,p);
orbitTrap = min(orbitTrap, abs(vec4(p.xyz,p2)));
if (p2 > Threshold) break;
}
float r = length(p);
return  0.5 * r * log(r) / length(dp);
}


So we get something like

Code:
float DEQT(vec3 pos) {

vec4 p = vec4(pos, 0.0);
vec4 dp = vec4(1.0, 0.0,0.0,0.0);

for (int i = 0; i <QTIterations; i++){

// Quaternion iterations
dp = 2.0* vec4(p.x*dp.x-dot(p.yzw, dp.yzw), p.x*dp.yzw+dp.x*p.yzw+cross(p.yzw, dp.yzw));
p = vec4(p.x*p.x-dot(p.yzw, p.yzw), vec3(2.0*p.x*p.yzw)) + QTC;

//rotation
p.xyz *= rot;

//  Box Folding
if (foldBoxIts > 0){
if ( i >= foldBoxStartIt && i < foldBoxStartIt + foldBoxIts){
//  Box Folding (v2) - separate axes + offset
p.x = clamp(p.x, -foldingLimitX, foldingLimitX) * foldingValueX - p.x + Trans.x;
p.y = clamp(p.y, -foldingLimitY, foldingLimitY) * foldingValueY - p.y + Trans.y;
p.z = clamp(p.z, -foldingLimitZ, foldingLimitZ) * foldingValueZ - p.z + Trans.z;
}
}
// Sphere Folding
if(foldSphereIts > 0){
// Sphere folding & scale
if ( i >= foldSphereStartIt && i < foldSphereStartIt + foldSphereIts){
float r2 = dot(p.xyz, p.xyz);
p *= clamp(max(MinRad2/r2, MinRad2), 0.0, 1.0);
p = p*scale + vec4(Julia,0);
}
}

float p2 = dot(p,p);
orbitTrap = min(orbitTrap, abs(vec4(p.xyz,p2)));
if (p2 > QTThreshold) break;

}

//QT
float r = length(p);
return  0.5 * r * log(r) / length(dp);

}

So we got p, we got dp then we introduce a few other transformations on p while leaving dp untouched for the final DE calculation.
Is the DE formula still valid if we do so? I have a feeling this is not exactly accurate and that might be a reason for much noise I am getting out of these images.

My math skills are really below my aspirations, so wrapping my head around all this gives me a hard time.
Just started thinking about it after having read syntopia's blogposts on DE fractals.






Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Mandelbox folding applied to a quaternion 3D Fractal Generation David Makin 8 4543 Last post March 18, 2010, 07:18:42 PM
by kram1032
initial messingabout with the new 'folding integer' formula in mandelbulb3d 1.4 Images Showcase (Rate My Fractal) kaini 4 4461 Last post April 14, 2010, 11:14:54 AM
by hyperben2
Folding Mandelbulb3D Gallery SteveJP 0 621 Last post April 05, 2011, 08:33:22 PM
by SteveJP
The Art of Folding Fragmentarium Gallery 3dickulus 0 690 Last post December 28, 2013, 02:18:22 PM
by 3dickulus
The Art of Folding Animations Showcase (Rate My short Animation) 3dickulus 2 1674 Last post December 29, 2013, 05:29:22 PM
by 3dickulus

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.158 seconds with 26 queries. (Pretty URLs adds 0.01s, 2q)