TechnoRobbo Posted June 29, 2013 Share Posted June 29, 2013 (edited) It Zigs! It Zags! It's a Ripple Plugin! Version 1.1 includes Vertical Zig Zagging Menu: Effects->Distort The Modulator modifies the Carrier Amplitude. The Example Valley of the Gods The Code Hidden Content: // Submenu: Distort // Name: TR's ZigZag // Title: TR's ZigZag - v1.1 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode double Amount1 = 10; // [1,100] Carrier Frequency double Amount2 = 0.5; // [0,3] Carrier Amplitude double Amount3 = 0.5; // [0,1] Carrier Offset double Amount4 = 2; // [1,100] Modulator Frequency double Amount5 = 0.15; // [0,3] Modulator Amplitude double Amount6 = 0; // [0,1] Modulator Offset bool Amount7 = false; // [0,1] Vertical ZigZag #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); double CF=0,MF=0; if (!Amount7) { CF = selection.Width /Amount1; MF = selection.Width /Amount4; }else{ CF = selection.Height /Amount1; MF = selection.Height /Amount4; } double CA = CF * Amount2; double COF = CF * Amount3; double MA= MF * Amount5; double MOF = CF * Amount6; ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { double rad,off; if (!Amount7) { rad = ((x + COF) % CF) / CF * 2 * Math.PI ; off =Math.Cos(rad) * CA; rad = ((x + MOF) % MF) / MF * 2 * Math.PI ; off =y + Math.Cos(rad) * MA + off; CurrentPixel = src.GetBilinearSampleClamped(x,(int)off); }else{ rad = ((y + COF) % CF) / CF * 2 * Math.PI ; off =Math.Cos(rad) * CA; rad = ((y + MOF) % MF) / MF * 2 * Math.PI ; off =x + Math.Cos(rad) * MA + off; CurrentPixel = src.GetBilinearSampleClamped((int)off,y); } dst[x,y] = CurrentPixel; } } } TRsZigZag.zip Edited December 28, 2015 by TechnoRobbo 1 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 30, 2013 Author Share Posted June 30, 2013 (edited) Version 1.1 posted adds Vertical Zig Zag feature Edited December 28, 2015 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 30, 2013 Share Posted June 30, 2013 I'm liking this. A nice effect. Many thanks for the update TechnoRobbo. Is your source code up-to-date too? Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
TechnoRobbo Posted July 1, 2013 Author Share Posted July 1, 2013 (edited) Yes the source code is up to date. Now. I forgot I had Vertical ZigZag mispelled. Thanks for catching it. Edited July 1, 2013 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.