Jump to content
John Rostron

Vexillomorphic transformations (Flag-Waving) in Photo

Recommended Posts

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:

5aa505737a6d7_UnionFlag.png.d935e7821017a941e6cb7c0bf92150bf.png

And waving in the breeze:

5aa50572d1f81_UnionFlagWave.png.b78245a340d299518c53e8545f5e55af.png

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

 


Windows 10, Affinity Photo 1.8,5 Designer 1.8.5 and Publisher 1.8.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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


Windows 10, Affinity Photo 1.8,5 Designer 1.8.5 and Publisher 1.8.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

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.


High-End Photographic Prints

 

 

Share this post


Link to post
Share on other sites
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


Alfred online2long.gif
Affinity Designer/Photo/Publisher for Windows • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.8.4.186 • Designer for iPad 1.8.4.4 • iPadOS 13.7 (iPad Air 2)

Share this post


Link to post
Share on other sites

Alfred to the rescue once again.

Thanks mate.


High-End Photographic Prints

 

 

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.