Linux Format

Screens of fractals and complex numbers

Last month, we introduced some basic movement on to the screen, with the famous stretching-scrolling Star Wars effect, and with it also came the notion of the texture. Intentionally focusing on the educational aspect of the article, we have concocted a very suboptimal texture format, but one that is very easy to understand for beginners, too.

First we’re introducing some wondrous concoctions known as fractals, and we will draw and zoom them around the screen. For the second part of this month’s tutorial, we are focusing on some stunning effects in order to demonstrate how clever texture manipulations can create some unexpected results. One of them is the rotozoom effect (an effect that rotates and zooms in and out) and the next one is the famous tunnel effect, which gives the viewer the illusion of flying through a tunnel.

But before we delve into more details for these effects, we need to lay the mathematical foundation used in implementing them. So dear reader, please head over to our boxouts and read upon a bit on the dark art of trigonometry and the mysterious concoction of complex numbers. Because we will use both of those notions heavily in this episode.

Biting our own tail

Fractals are intricate and self-replicating geometric patterns characterised by self-similarity, where parts of the structure resemble the whole at different scales. Generated through iterative processes or mathematical equations, fractals exhibit infinite detail and complexity emerging from a simple formula. They are found in nature, from clouds and mountains to biological structures, such as the pattern found on trees or ferns for lovers of Latin names). Fractals play a prominent role in computer graphics, art and scientific simulations, with examples such as the Mandelbrot set and the Julia set

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format8 min read
Create A Fyne Journaling App
Credit: https://fyne.io Over the past decade, we have seen great improvements in the graphical software user experience and corresponding advancements in the tools that are used to create compelling apps for our phones and tablets. Unfortunately, bui
Linux Format1 min read
Tom’s HARDWARE
No matter if you're building a PC, buying a laptop or learning about robots, Tom’s Hardware has all the comprehensive knowledge you need. Scan & Subscribe for free! ■
Linux Format10 min read
Create A Play-by-mail User Interface
This is the second article in our series about creating play-by-mail games. These are games that are now played over the web (or by email), and we’ll be looking at various aspects of this, including user input, use of JSON, clans, and free versus pai

Related