# 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:

And waving in the breeze:

And here is a macro that implements these transformations:

And a macro library containing the single macro:

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 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 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 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 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.

Alfred
Affinity Designer/Photo/Publisher for Windows • Windows 10 Home (4th gen Core i3 CPU)

##### Share on other sites

Alfred to the rescue once again.

Thanks mate.

High-End Photographic Prints

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×

×

• #### Affinity

×
• Create New...