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

### Author Topic:  Sphere-Inversion  (Read 142 times)

0 Members and 1 Guest are viewing this topic.

#### Sabine62

• Moderator
• Posts: 1093
##### Sphere-Inversion
« on: June 05, 2020, 10:52:12 AM »
I always have to search for this...

Code: [Select]
Sphere-inversion#group SphereInversionuniform 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);}

« Last Edit: June 05, 2020, 03:14:10 PM by Sabine62 »
To thine own self be true

#### 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

#### Sabine62

• Moderator
• Posts: 1093
##### 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

Thanks a lot, mclarekin, will change right away!

### Similar Topics

###### 4th Power Juliabulb Inversion

Started by Kalter Rauch on ChaosPro

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

Started by Kalter Rauch on ChaosPro

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

Started by Kalter Rauch on ChaosPro

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

Started by kosalos on Programming

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

Started by Kalter Rauch on Fractal Image Gallery

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