Skip to content

WWDC20 Swift Student Challenge Playground showing affine transformations in SwiftUI

License

Notifications You must be signed in to change notification settings

roland-schmitz-academy/WWDC20-SpiralField

Repository files navigation

Spiral Field - WWDC20 Swift Student Challenge Award Winner

Spiral Field Playground, Page 4

TL;DR

Run the Spiral Field.playgroundbook with the Playgrounds app on a Mac or an iPad.

There is also an app version which runs on iOS and on macOS. Just open the WWDC Spirals.xcodeproj with Xcode and run it.

The story behind my Playground

I had the idea for this playground 35 years ago in 1985 when I started coding with C and implemented a version of the Graphical Kernel System (GKS). My Playground is all about Affine Transformations. They have been very important in GKS and I created some beautiful graphics in that time.

During my work and research 35 years ago I found a special Affine Transformation which I called "Inner Rotation". When you repeatedly use this transformation to draw the same rectangle or triangle again and again you can create some really nice looking spirals.

If you then arrange the spirals in several rows and columns and optionally alternating between normal and mirrored forms of the spirals you can create some beautiful diagrams. I plotted them on paper 35 years ago, because we had no high resolution graphics screen at that time. I will probably find some of the original graphics in the attic.

The talks about SwiftUI from WWDC last year have been very exciting and fascinating for me. That's why I tried to learn all about SwiftUI. At the Developer Academy in Naples, Italy I started to use SwiftUI for real projects and I am sure it is the future for the UI part of all Apple devices.

When I realized that Affine Transformations are available and very useful in SwiftUI I eventually remembered what I learned about them 35 years ago.

In my Playground I wanted to show how easy it is to use SwiftUI and Affine Transformations to create some beautiful graphics. I used the "Inner Rotation" Transformation which I remembered from 35 years ago to create a dynamic experience where you can change the main parameters for the diagrams on the fly and get instant feedback on the iPad screen.

The Playground has 4 pages. The first two pages explain a little bit about Affine Transformations and you can experiment with them. The third page shows the Inner Rotation Transformation and how to create a nice spiral with repeatedly applying the transformation. On the last page you have the chance to play with the main parameters to create your individual favorite diagram. Have fun.

About

WWDC20 Swift Student Challenge Playground showing affine transformations in SwiftUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages