Jump to content

Recursive Pattern Editor


Recommended Posts

I like programming but find it easy to get out of the habit.  To get myself into it again recently, I decided to develop a small application to draw and animate patterns of recursive lines.  It's come along pretty well.  I'm not a maths guy and not much of a programmer, so it feels like quite an achievement.

 

It has a few options, but the patterns it draws look like this:

 

Or this:

 

It works rather like drawing one side of a Koch snowflake but with a variable number and position of "corners".  Also the corners can be set off on smooth paths to render animations.

 

Here's one side of a Koch snowflake dancing, it may give some impression:

 

 

There are other example videos on my youtube channel, including this one which isn't great but shows me using the app.  Actually it's a slightly older version of the app, but you get the idea...

 

It's been a fun project.  I'm sure fancy apps like blender or Maya (does that still exist) use similar and cleverer systems to generate cloud and flame effects.  For myself, an amateur, I'm pretty pleased with my results.

 

I'm not sure I can think of a great purpose for them.  When I look at the firey one above I reckon I could render small sections of that with many hundreds of frames and it could be used as a component in some other video or video game production.  If they were on a budget, maybe?

 

Regardless, it's been fun to make and the patterns are fascinating to me.  I could go on and on about what I think about them, but it'd be about as interesting as hearing about my dreams last night.

 

The app is still very clunky in certain ways for sure.  I'll finish it up and post it somewhere along with the source once I've made sure it's an ok thing to do.

 

 

 

Link to post
Share on other sites
  • 2 weeks later...

I'm still pluggin away at this. I've made rendering into a seperate process and done a few things to the GUI to try to make it easier to use. It was hard work doing the renderer and making it reliable as a process, so I've been grateful to think about "simpler" things like gadgets and worktop controls. But now the editor is close to being good enough and I've got to think about some details of how it renders again.

 

I'm aware that some videos have clear bands of colour on certain displays. Half my brain is keen to dismiss this as their problem, but that's not very constructive is it? Maybe it's the displays on which the vid looks fine that lack some sensitivity, I don't know. There might be things in my colour generating code that do things im not expecting so I have to take a look.

 

This is a vid of me using the editor as it is now. I was surprised to find that ffmpeg could capture my desktop quite nicely on my modest laptop if I accepted huge initial filesizes and lossless vids, which is OK for clips like this.  Then, of course, I have to see what YT actually shows and it's seriously worse. I'm not really complaining about this, I love YT really, more just mentioning that I'm aware this looks pretty shod at parts. I'll keep playing with the settings. Also, does YT offer better quality if I pay? I'll find out...

 

 

 

This is the third video I've uploaded recently of me using the app, the others are worse :)

 

I'll probably be back in another week or two with some more glacial progress.

Link to post
Share on other sites
  • 3 weeks later...

This is within a couple of days of being finished. Very little will change between here and how it'll be in the end and I'm ready to be done with it :) It's been fun, but there are other little things needing made.

 

spacer.png

 

There isn't much to it, when I consider how much lockdown time it's occupied. The last couple of weeks have been spent building functionality I didn't intend at the outset. Once the renderer was external it became slightly easy to use which meant I spent more time playing with it. This had the knock-on effect of making me realise where I spent my actual time and what the editor also had to do.

Which was view the output easily, dump the rendered array as well as the image and allow me to tweak the colouring and pixel-height-scaling options in something closer to real-time. Drawing all the lines into the array takes a long time, painting the height map created takes about a second at most for a 1920*1080 image. Now I can do this, committing to many hours for a single image makes more sense.

 

spacer.png

 

Being able to view any number of outputs to compare different settings, or the same settings against different frames is useful. Seeing the change in height distributions before and after scaling also helps me understand what effect my scaling techniques are having. These ones looks quite nice on my displays, I'm still unsure if some people get distinct banding effects.

 

Khd5hYP.png

 

Lt7hHHc.png

 

Using Exponents less than one and Logarithms give useful results when "high" peak pixels need flattened but not made into a plateau. The problem is (being not a maths guy) I don't really have a clear idea what to expect from these things, so graphs help. And look fancy so are fun to make. They could be more informative but...

 

I don't think I'm gong to take it much further. It's fairly functional as it is and I'm happy enough. There are quite a few things that would improve it. I'll probably use it for playing around or making the occasional wallpaper, if other options are super desirable I might come back to it.

 

I'm using Monkey2, which is lovely but no longer in development. Certain problems with the app as it stands are a bit stumping because of this. So I have to think about what to do next, moving to C++ being a tempting and daunting prospect.

 

I'd like to use the Monkey code I have (the GUI and things) to make one more smaller project, though. To keep myself focused on this app, I recorded a lot of work on it as a video diary which meant onscreen doodling. I found using the Windows Paint program a pain and would quite like to make one with the options I want handy. Something very simple.

 

Ty for reading my self-indulgent lockdown project diary. This sort of thing is a niche corner of a niche pursuit. Soon I might be back to show off about making the most pointless little paint program you ever saw. It's how I always find programming, the simplest things can be satisfying.

 

PS. I'm embedding images from imgur. If there's a better way I'll do it. Also this post is more pink that I intended.

 

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

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. Use of this website is subject to our Privacy Policy, Terms of Use, and Guidelines.