Also the Animated version seems working fine
Please note that Animated Sphere (used here ) use a very different type of mapping of Map Sphere (and of Distort Sphere ).. i prefer that from the animated version (That may used for still just setting the frames to 1. )
ooopss something unexpected the filter work fine but something wrong happened when i saved (the code not the image)
I try again now ...OK now seems fine
TIP use on images that could be tiled horizontally (as example equirectangular images ..or simply mirror first on the x axis )
here the code
#Sphere Filter
#Originally by Herbert Poetzl
#Adapted for animation by Nathan deGargoyle
#Further Adaptation by Josh Sommers (Pisco Bandito)
# Badly edited by PhotoComiX to add a couple of effects
#RotateX_Start is the starting rotation on the X axis
#RotateY_Start is the starting rotation on the Y axis
#RotateZ_Start is the starting rotation on the Z axis
#Add_RotateX this value is added to RotateX_Start
#Add_RotateY this value is added i to #RotateY_Start
#Add_RotateZ this value is added to Start_RotationZ
#Negative values for "Add_Rotate" allow to invert direction as from 340° to 10° ,"flip" could do it much better
# then if by adding negative values the value of alfa, gamma or zeta become negative results willl be weird
#Multiply_X is the number of times to multply the rotation specified by RotateX_End.
#Multyply_Y is the number of times to multiply the rotation specified by RotateX_End.
#Multiply_Z is the number of times to multiply the rotation specified by RotateX_End.
#Mulltiply example:
#If you set Add_RotateX to 360 and Multiply_X to 10 the sphere will rotate 360 degrees on the X axis ten times.
#If you set Add_RotateX_ to 180 and Multiply_X to 10, then sphere will rotate 360 degrees on the X axis 5 times.
#Zoom_Start is the starting zoom
#Add_Zoom_ This value is added to the Zoom_Start value
#Background is the color to use for the background
#BackgroundOpacity is the opacity of the background, 0 for transparent, 100 for opaque. Your image must have an alpha channel for this to work.
############################################################
filter Sphere (image in,
int RotateX_Start: -360-360 (90),
int RotateY_Start: -360-360 (90),
#Starting from RotateY_Start =120 you will start with sphere fully invisible then it will start to appear
#When equal or more then 0 sphere will become fully visible
int RotateZ_Start: -360-360 (0),
int Add_RotateX: -360-360(0),
int Add_RotateY: -360-360(0),
int Add_RotateZ: -360-360(0),
int Multiply_X: 1-100(1),
int Multiply_Y: 1-100(1),
int Multiply_Z: 1-100(1),
int Zoom_Start: 1-300 (100),
int Add_Zoom: 1-300 (100),
bool Flip_X,
bool Flip_Y,
int BackgroundOpacity: 0-100 (0),
color background)
rd=min(X,Y)*((Zoom_Start/100)+(t*(Add_Zoom-Zoom_Start)/100));
if r>rd then
rgba:[background[0],background[1],background[2],BackgroundOpacity/100];
else
beta = (pi/180) * RotateX_Start + (pi/180)*(Add_RotateX*Multiply_X*t);
gamma = (pi/180) * RotateY_Start + (pi/180)*(Add_RotateY*Multiply_Y*t);
alpha = (pi/180) * RotateZ_Start + (pi/180)*(Add_RotateZ*Multiply_Z*t);
sa=sin(alpha);
sb=sin(beta);
ca=cos(alpha);
cb=cos(beta);
theta=a;
phi=acos(r/rd);
x0=cos(theta)*cos(phi);
y0=sin(theta)*cos(phi);
z0=sin(phi);
x1=ca*x0+sa*y0;
z1=(-sa*-sb*x0)+(ca*-sb*y0+cb*z0);
if z1 >= 0 || 1 then
y1=cb*-sa*x0+cb*ca*y0+sb*z0;
else
z1=z1-2*cb*z0;
y1=cb*-sa*x0+cb*ca*y0-sb*z0;
end;
theta1=atan(-x1/y1)+(if y1>0 then pi/2 else 3*pi/2 end);
phi1=asin(z1);
ix = ((theta1*1+gamma)%(2*pi)-pi)/pi*X;
iy = -phi1/(pi/2)*Y;
if Flip_X then
ix = -ix
end;
if Flip_Y then
iy= -iy
end;
in(xy:[ix,iy])
end
end
filter rel2ellv3(image in)
xprime=x/sqrt(1-4*(y/H)*(y/H));
yprime=y/sqrt(1-4*(x/W)*(x/W));
in(xy:[xprime,yprime])
end
filter __composer_filter__ (image Sphere_in, int Sphere_RotateX_Start : -360 - 360 (90), int Sphere_RotateY_Start : -360 - 360 (90), int Sphere_RotateZ_Start : -360 - 360 (0), int Sphere_Add_RotateX : -360 - 360 (0), int Sphere_Add_RotateY : -360 - 360 (0), int Sphere_Add_RotateZ : -360 - 360 (0), int Sphere_Multiply_X : 1 - 100 (1), int Sphere_Multiply_Y : 1 - 100 (1), int Sphere_Multiply_Z : 1 - 100 (1), int Sphere_Zoom_Start : 1 - 300 (100), int Sphere_Add_Zoom : 1 - 300 (100), bool Sphere_Flip_X (0), bool Sphere_Flip_Y (0), int Sphere_BackgroundOpacity : 0 - 100 (0), color Sphere_background) Sphere_out = Sphere(Sphere_in, Sphere_RotateX_Start, Sphere_RotateY_Start, Sphere_RotateZ_Start, Sphere_Add_RotateX, Sphere_Add_RotateY, Sphere_Add_RotateZ, Sphere_Multiply_X, Sphere_Multiply_Y, Sphere_Multiply_Z, Sphere_Zoom_Start, Sphere_Add_Zoom, Sphere_Flip_X, Sphere_Flip_Y, Sphere_BackgroundOpacity, Sphere_background); rel2ellv3_out = rel2ellv3(Sphere_out); rel2ellv3_out(xy) end
_________________ My 3D Gallery on Deviantart http://photocomix2.deviantart.com/ Main gallery http://www.flickriver.com/photos/photocomix-mandala/ Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/
![Image](http://farm4.static.flickr.com/3262/2346652286_fe022f3934_o.jpg)
Mrs Wilbress
|