glass-squares-hemisphere { ; KPK, 09 Nov 1999 ;Generated from Luke Plant's Glass Hemisphere ;and Mark Townsend's Glass Squares transformations transform: float x1 = real(#pixel) float y1 = imag(#pixel) x1 = x1 + x1 % @a y1 = y1 + y1 % @a #pixel = x1 + flip(y1) complex z2 = #pixel-@Center float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@width if x1 > 1 #pixel= #pixel else ; refraction calcs theta1 = acos(x1) y1=sin(theta1) beta = asin(x1/@n) x2 = -y1/real(tan(theta1+beta))+ x1 ; move pixel #pixel = z2/x1 * x2 + @Center endif default: title = "Squared Hemisphere" param a caption = "Square size" default = 0.1 endparam param center caption="Center of Hemisphere" default=(0,0) endparam param width caption = "Width" default = 1.0 hint = "Width of Hemisphere" endparam param n caption = "Refractive Index" hint="Refractive Index of Hemisphere" default = 2.0 endparam } magic-glass { ; KPK, 09 Nov 1999 ;Generated from Luke Plant's Glass Hemisphere ;and Mark Townsend's Glass Squares transformations transform: float x1 = real(#pixel) float y1 = imag(#pixel) x1 = x1 + x1 % @a y1 = y1 + y1 % @a #pixel = x1 + flip(y1) complex z2 = #pixel-@Center float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@width if x1 > 1 #pixel= #pixel else ; refraction calcs theta1 = round(x1) y1=sin(theta1) beta = asin(x1/@n) x2 = -y1/real(tan(theta1+beta))+ x1 ; move pixel #pixel = z2/x1 * x2 + @Center endif default: title = "Magic Glass" param a caption = "Square Size" default = 0.5 endparam param width caption = "Width" default = 0.61 hint = "Width of Hemisphere" endparam param n caption = "Refractive Index" default = 2.0 hint = "Refraxtive Index of Hemisphere" endparam } magic-glass-ii { ; KPK, 09 Nov 1999 ;Generated from Luke Plant's Glass Hemisphere ;and Mark Townsend's Glass Squares transformations transform: float x1 = real(#pixel) float y1 = imag(#pixel) x1 = x1 + x1 % @a y1 = y1 + y1 % @a #pixel = x1 + flip(y1) complex z2 = #pixel-@Center float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@width if x1 > 1 #pixel= #pixel else ; refraction calcs theta1 = round(x1) y1=sin(theta1) beta = asin(x1/@n) x2 = -y1/real(recip(theta1+beta))+ x1 ; move pixel #pixel = z2/x1 * x2 + @Center endif default: title = "Magic Glass II" param a caption = "Square size" default = 0.5 endparam param width caption = "Width" default = 0.61 hint = "Width of Hemisphere" endparam param n caption = "Refractive Index" default = 2.0 hint = "Refractive Index of Hemisphere" endparam } fool-toy { ; KPK, 09 Nov 1999 ;only a fool is able to mix up foolish maths ;from Luke's and Mark's transfoolations transform: float x1 = real(#pixel) float y1 = imag(#pixel) x1 = @a * sin(@a * imag(@fn1(#pixel))) y1 = @a * sin(@n * real(@fn2(#pixel))) #pixel = x1 + flip(y1) complex z2 = #pixel-@Foolpoint float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@fool if x1 > 1 #pixel= #pixel else ; something strange theta1 = round(x1) y1=sin(theta1) beta = asin(x1/@n) x2 = -y1/real(tan(theta1+beta)) + x1 ; move pixel #pixel = z2/x1 * x2 + @Foolpoint endif default: title = "Foolish Toy" param a caption = "Fool Size" default = 1.0 hint = "Every Fool 's a Fool" endparam param fool caption = "Fool" default = 2.1 hint = "Fool of a Factor" endparam param n caption = "Reflecting Fool" default = 2.0 hint = "Something's happening" endparam func fn1 caption = "Lying Fool" default = ident() hint = "Lay down" endfunc func fn2 caption = "Jumping Fool" default = ident() hint = "Up! Up Up" endfunc } 3D-reflection { ; KPK, 10 Nov 1999 ;from parts of Luke Plant's ;and Mark Townsend's transformations transform: float x1 = real(#pixel) float y1 = imag(#pixel) x1 = @a * atan(@a * imag(@fn1(#pixel))) y1 = @a * log(@n * real(@fn2(#pixel))) #pixel = x1 + flip(y1) complex z2 = #pixel-@Center float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@random if x1 > 1 #pixel= #pixel else ; reflexion theta1 = round(x1) y1=abs(theta1) beta = sin(x1/@n) x2 = -y1/real(tan(theta1+beta)) + x1 ; move pixel #pixel = z2/x1 * x2 + @Center endif default: title = "3D Reflex" param a caption = "Reduction" default = 1.0 hint = "Try Small Values" endparam param random caption = "Random" default = 2.1 hint = "Effect depends on function settings" endparam param n caption = "Splitting" default = 2.0 hint = "Distance between reflections" endparam func fn1 caption = "Reflex Effect" default = ident() endfunc func fn2 caption = "Bending Effect" default = ident() endfunc } Sierp-Sphere1 { ; November 11, KPK ;derived from Luke Plant's Glass Hemisphere and ;Mark Townsend's Sierpinski Glass ;using default values for Square Size and ;Multiplier lead to Sierpinsky Triangle like results, ;using values <1 for Square Size or/and <0.005 for ;Multiplier lead to glass drop or glass sphere effects transform: w = #pixel int frm_iter = 0 while frm_iter < @max_iterations if (imag(w) > 0.5) w = 2 * real(w) + flip(2 * imag(w) -1) elseif (real(w) > 0.5) w = 2 * real(w) -1 + flip(2 * imag(w)) else w = 2 * real(w) + flip(2 * imag(w)) endif frm_iter = frm_iter + 1 endwhile float sx = real(w) * @c float sy = imag(w) *@c float x = real(#pixel) float y = imag(#pixel) x = x + sx % @b y = y + sy % @b #pixel = x + flip(y) complex z2 = #pixel-@ctr float x1 = 0 float y1 = 0 float beta = 0 float theta1 = 0 float x2 = 0 float x1 = cabs(z2)/@width if x1 > 1 #pixel= #pixel else ; refraction calcs theta1 = acos(x1) y1=sin(theta1) beta = asin(x1/@n) x2 = -y1/real(tan(theta1+beta))+ x1 #pixel = z2/x1 * x2 + @ctr endif default: title = "Sierpinsky Sphere" param b caption = "Square size" default = 1.0 endparam param c caption = "Multiplier" default = 0.01 endparam param max_iterations caption = "Iterations" default = 10 endparam param n caption = "Refractive index" default = 2.0 hint = "Refactive index of Sphere" endparam param width caption = "Width" default = 1.0 hint = "Width of Sphere" endparam param ctr caption = "Center" default = (0,0) hint = "Center of Sphere" endparam }