subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublicvarnametitlewww.fxscript.org for moreuitype typedefaultstringvalue angleofaxis angle of axisuiinfolabels horizontalverticalmin?€max@?€?€ borderwidthborder BÈ bordercolorcolourÿÿ spindirection clockwise  accelerationease inÀ @privatestaticsscriptÕ//--------------------------------// // Stib's spin 3D 1.1 // //for more visit www.fxscript.org // //--------------------------------// //© 2005 stephen dixon //This software is free - you may use, modify and distribute it as you wish, with the following provisos: //*it may not be used by any military organisation, or to produce goods or services for any military organisation. //* this source code must remain open //* this message and the accompanying doccumentation files must remain with the source //additionally this software is released under the terms of the GNU general Public license //see http://www.gnu.org/licenses/gpl.html for the full text of this license or look at the readme that came with the plugins //this software comes with no warranty of fitness for any purpose whatsoever, ok. //thanks to Gil for asking the obvious question. scriptid "stib's Spin3D" transition "stib's spin3D 1.1.2"; group "stib's transitions"; wipeCode(19, 100); producesAlpha; input varName, "www.fxscript.org for more", Label, "string" input angleofaxis, "angle of axis", Popup, 1, "horizontal", "vertical" input borderWidth, "border", slider, 0, 0, 100; input borderColor, "colour", color, 255, 0, 0, 0; input spinDirection, "clockwise", checkbox, true //--------------Ease In control --------------- input Acceleration, "ease in", Slider, 0, -2, 2 code on fabs (value _n) return (_n<0 ? -_n : _n); end; angleofaxis = (angleofaxis-1)*90 if(spinDirection) spinDirection = 2 else spinDirection = -2 end if; //convert true/false into +/-1 float h, v, x, y, xprime, yprime, offsetangle, angleofview; point source[4], target[4], poly[4], centerofview, flopper; point3d target3d[4], center3d, eye3d; //-------------stib's ease in ease out------------------- float e, magicnumber, newRatio; magicnumber = 8; e = 2.71828; //just defining a basic constant newRatio = Acceleration*(1-2/(1+power(e,magicnumber*power(ratio,e))))+(1-Acceleration)*ratio if srcIsGap1 newRatio =0.5 + newRatio / 2 else if srcIsGap2 newRatio /=2 end if; //----------------------------------------------------- borderColor.a = 255; angleofview = 30; boundsOf(Dest, target); centerOf(target, centerofview); source = target; poly = target; if borderwidth > 0 dimensionsof(dest, h, v); borderwidth *= h / 640; line(target[3], target[0], src1, borderColor, borderwidth); line(target[1], target[2], src1, borderColor, borderwidth); line(target[3], target[0], src2, borderColor, borderwidth); line(target[1], target[2], src2, borderColor, borderwidth); borderwidth /= aspectof(dest); line(target[0], target[1], src1, borderColor, borderwidth); line(target[2], target[3], src1, borderColor, borderwidth); line(target[0], target[1], src2, borderColor, borderwidth); line(target[2], target[3], src2, borderColor, borderwidth); end if; x = distto(poly[0], poly[1]); y = distto(poly[1], poly[2]) * aspectof(dest); xprime = x*fabs(cos(angleofaxis)) + y*fabs(sin(angleofaxis)); yprime = x*fabs(sin(angleofaxis)) + y*fabs(cos(angleofaxis)); scale(poly, centerofview, xprime/x, yprime/y); rotate(poly, centerofview, angleofaxis, aspectof(dest)); convert2dto3d(centerofview, center3d, 0); convert2dto3d(centerofview, eye3d, distto(poly[0], poly[1])/(2*tan(angleofview/2))); scale(target, centerofview, 1, aspectof(dest)); convert2DTo3D(target, target3d, 0); rotate3D(target3d, center3d, 0, 0, -angleofaxis); rotate3D(target3d, center3d, 0, 90*spinDirection*newRatio, 0); rotate3D(target3d, center3d, 0, 0, angleofaxis); convert3DTo2D(target3d, target, eye3d); scale(target, centerofview, 1, 1/aspectof(dest)); if angleofaxis==0 flopper = {-1,1} else flopper = {1,-1} end if channelfill(dest, 0, 0, 0, 0); if (newRatio<0.5) if srcIsGap1 blitrect(Src2, source, Dest, target); else blitrect(Src1, source, Dest, target); end if; else source *= flopper if srcIsGap2 blitrect(Src1, source, Dest, target); else blitrect(Src2, source, Dest, target); end if end if; if ( !fieldprocessing || fieldNumber > 1 ) srctype1 = kblack; end if scriptid stib's Spin3Dnamestib's spin3D 1.1.2groupstib's transitionswipecode wipeaccuracyd producesalphaencoded