John Rostron Posted March 11, 2018 Share Posted March 11, 2018 This is an extension of my tutorial on Trigonometrical transformations using Filter > Distort > Equations. This one is focused on simulating flags waving in a light wind. Flags have an advantage in that they have a standard shape (width is twice the height). Edit: I have been told that this is not true. I stand corrected. To get the desired waving, I apply a sine transformation to each of the x and y-axes. The equations to apply are: x=(x+20*sin(360*y/h))/c-100*b y=y+a*(h/10)*sin(2*360*x/w)-(x/w)*h/10 I add a sideways sine wave to the x-axis as a function of the y-position. When the flag waves, the visual width is decreased, so I have added a parameter c which scales the width of the flag. The parameter b is an offset, since the left-hand corners of the flag can otherwise move outside the canvas. The y-axis also has a sine wave, depending on the x-position. The parameter a determines the magnitude of this sine wave. The final expression (-(x/w)*h/10) ensures that the fly (RHS in this case) is below the hoist (LHS here). (Definitions: hoist is the part next to the flagpole; fly is the part flying free.) Here is the UK Union Flag, plus a bit of extra space above and below to create room: And waving in the breeze: And here is a macro that implements these transformations: FlagWaving.afmacro And a macro library containing the single macro: FlagWaving.afmacros The parameters should appear when you run the macro. Parameter a controls the vertical wave; parameter b controls the horizontal offset; parameter c controls the overall horizontal scaling. This macro will not simulate a flag in too strong a wind, where the parts overlap! John GryphonArt, Smotank, Alfred and 1 other 4 Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050 Link to comment Share on other sites More sharing options...
PaulEC Posted March 11, 2018 Share Posted March 11, 2018 Quote Flags have an advantage in that they have a standard shape (width is twice the height). Sorry but this is just not correct. Flags come in all sorts of different shapes and sizes. Just Google "flags" and take a look! John Rostron and Alfred 2 Quote Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz : 32GB RAM : Intel UHD Graphics 630 : Windows 10 Home Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad "Beware of false knowledge, it is more dangerous than ignorance." (GBS) Link to comment Share on other sites More sharing options...
John Rostron Posted March 11, 2018 Author Share Posted March 11, 2018 54 minutes ago, PaulEC said: Sorry but this is just not correct. Flags come in all sorts of different shapes and sizes. Just Google "flags" and take a look! You are quite right. I was still remembering what I learned as a Scout sixty years ago. It was probably incorrect then! John Quote Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo). CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050 Link to comment Share on other sites More sharing options...
Richard S. Posted July 15, 2018 Share Posted July 15, 2018 Any chance someone could convert this macro to a macroS file, so that it can be used on Photo for iPad? Any help appreciated, as I don’t have my Mac available to convert it myself. Thank you. Quote High-End Photographic Prints Link to comment Share on other sites More sharing options...
Alfred Posted July 15, 2018 Share Posted July 15, 2018 56 minutes ago, DesignMeister said: Any chance someone could convert this macro to a macroS file, so that it can be used on Photo for iPad? Library (*.macros) file duly attached. Flag-waving.afmacros John Rostron and Richard S. 1 1 Quote Alfred Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.5.1 (iPad 7th gen) Link to comment Share on other sites More sharing options...
Richard S. Posted July 15, 2018 Share Posted July 15, 2018 Alfred to the rescue once again. Thanks mate. Alfred 1 Quote High-End Photographic Prints Link to comment Share on other sites More sharing options...
GryphonArt Posted August 16, 2023 Share Posted August 16, 2023 Thank you John Rostron, took me a while to find where to do this and made mine a little calmer in the wind.TeamTigsisle_Flag3B2_Flying2"B&W.pdfTeamTigsisle_Flag3B2_Flying2"B&W.pdfTeamTigsisle_Flag3B2_Flying2"B&W.pdf Quote 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.
Note: Your post will require moderator approval before it will be visible.