• January 28, 2021, 01:41:22 PM

Login with username, password and session length

Author Topic:  Sphere-Inversion  (Read 142 times)

0 Members and 1 Guest are viewing this topic.

Offline Sabine62

  • Moderator
  • ******
  • Posts: 1093
  • It's just a jump to the left...
    • sabine62.deviantart.com
Sphere-Inversion
« on: June 05, 2020, 10:52:12 AM »
I always have to search for this...  :fp: ;D

Code: [Select]
Sphere-inversion

#group SphereInversion
uniform vec3 InvCenter; slider[(-180,-180,-180),(0,0,0),(180,180,180)]
uniform float InvRadius; slider[0.01,0.1,100]
uniform vec3 ReCenter; slider[(-5,-5,-5),(0,0,0),(5,5,5)]
uniform bool SphereInversion; checkbox[false]


float DE(vec3 p){
if(SphereInversion){
p=p-InvCenter-ReCenter;
float r=length(p);
float r2=r*r;
                float InvRadius2=InvRadius * InvRadius;
p=(InvRadius2/r2)*p+InvCenter;
float de=DE1(p);
de=r2*de/(InvRadius2+r*de);
return de;
}
else return DE1(p);
}


Linkback: https://fractalforums.org/code-snippets-fragments/74/sphere-inversion/3556/
« Last Edit: June 05, 2020, 03:14:10 PM by Sabine62 »
To thine own self be true

Offline mclarekin

  • 3c
  • ***
  • Posts: 806
Re: Sphere-Inversion
« Reply #1 on: June 05, 2020, 02:46:54 PM »
you can use  invertRadius2  slider  and save some multipication


Offline Sabine62

  • Moderator
  • ******
  • Posts: 1093
  • It's just a jump to the left...
    • sabine62.deviantart.com
Re: Sphere-Inversion
« Reply #2 on: June 05, 2020, 03:10:01 PM »
you can use  invertRadius2  slider  and save some multipication

Optimization... one of my many weak points :))  ;D

Thanks a lot, mclarekin, will change right away!  :thumbs:


xx
4th Power Juliabulb Inversion

Started by Kalter Rauch on ChaosPro

1 Replies
350 Views
Last post November 20, 2017, 12:55:15 AM
by Kalter Rauch
xx
3rd Power Juliabulb Inversion

Started by Kalter Rauch on ChaosPro

1 Replies
315 Views
Last post November 21, 2017, 02:24:53 AM
by Kalter Rauch
xx
5th Power Juliabulb Inversion

Started by Kalter Rauch on ChaosPro

0 Replies
267 Views
Last post November 01, 2017, 12:53:43 AM
by Kalter Rauch
clip
Add spherical inversion to any 3D fractal

Started by kosalos on Programming

2 Replies
159 Views
Last post July 01, 2020, 09:53:11 AM
by mclarekin
xx
GIMPed Lyapunov Inversion

Started by Kalter Rauch on Fractal Image Gallery

3 Replies
297 Views
Last post July 14, 2018, 09:57:23 PM
by Kalter Rauch