Mystify 2.0

Mystify is the name of that screensaver on Windows. No, not the one with the pipes or the 3D text one – the other one. The one with the bouncing lines. You’ve got it.

Since I created some simplified OpenGL/GLFW 2D basecode yesterday and introduced it to my diploma multimedia class today, I thought I’d set them a task: to replicate this astonishing technological feat of graphical programming, only better! Like the billion dollar man version of it! In an hour!

And while they were doing their version I did mine, which looks like this…

Yup, that’ll be the mystify screensaver then.. =P

Full source code after the break for those who fancy a peak under the hood…




Note: If you want to compile this on Windows, you’ll need to include windows.h before gl.h – just so ya know…

10 thoughts on “Mystify 2.0”

  1. Very nice! Any chance of a compiled version for download? Or even what software you recommend in order to compile this at home? That’d be cool too.

    1. I’d be happy to give you a compiled version if that’s what you’d really like, but it’s far more fun to have the source code and be able to play with it…

      So in that spirit, head on over and get yourself a copy of the MinGW version of Code::Blocks from here: – you want the codeblocks-12.11mingw-setup.exe version.

      Then you can grab an updated version of the Mystify code I put together as a Code::Blocks project for you from here:

      The above project has the GLFW library built into it (libs and headers) so it’s completely standalone – once Code::Blocks is installed you should have no problem opening the .cbp project and then building and running the program.

      There’s lots of static constants to do with how many points are in a shape, how fast the shapes move, how often and how quickly they change colour etc. – hope you have some fun playing around with it!

  2. Why on earth didn’t I specify the number of points in the GL_LINE_LOOP to be a constant, instead of hard-coding ‘4’ everywhere?

    In fact, I’d do a ton of things differently if I wrote this again, but no, I’m just navel-gazing at an old post because somebody asked me about it, and I hadn’t looked at the post in years…

  3. I’m a composer that would very much like to utilize this technology with my music.
    Trying desperately to understand your posts made me realize (after a giant brain fart) there’s no way I could even start to understand code.
    My question is… is there a software available that I would be able to manipulate (ie via a mouse) the movement of the graphics?
    Thanks very much,

    1. Hi Randy,

      Mmm – tough one. What you’re after is called a ‘visualiser’ (or ‘visualizer’ I suppose, depending on where you’re from). There are stacks of these available, the best one(s) I can think of come with Winamp music player (Advanced Visualisation Studio (AVS) and MilkDrop) – however, although you can switch and change between presets which react to the music dynamically (i.e. stab keys at various points during the music and the current preset changes to whatever), they don’t typically allow for a great deal of user interaction.

      One exception to this rule I can think of is the Jeff Minter written visualiser for the Xbox 360, which is called Neon – this allows you to plug in up to 4 controllers and do various things on them to control the visualisation in real-time. Here’s an example of it in action:

      You might also like to look into DJ/VJ tools – as this sounds like something many people would be interested in to make good looking interactive visuals in night-clubs or such – perhaps google “music visualisation tools” or “interactive music visualisation” and you should get something that’ll be of use.

      Hope this helps!

      1. I can’t tell you how much I appreciate this!
        For years I’ve been wanting to manipulate these types of visuals but couldn’t find an app to do so.
        Although I’m sure I’ll be facing quite a learning curve (and need to buy an iPad) I think it will be worth it in the long run.
        Thanks again so much,

          1. After your suggestions I had googled “interactive music visualisation” and found Futura Epsis-
            (check out the first vid).
            I wound up downloading a trial of a program called “Magic” which is cool (as expected will have a learning curve) but I may come back to the Futura Epsis since it has so much more control ( being able to draw in instrument parts…ie…an ascending violin part moving with a sweeping, upward movement).
            At some point I’d like to draw in different parts with different colors and different widths (ie thin white strokes for violin and thicker blue strokes for cello) …Hopefully that makes sense.
            Thanks again for your post, I didn’t even know what keywords to search for!

  4. Hot diggety, a couple years ago I started a small effort to make a highly-configurable version that can be shipped with the XScreensaver project, because Mystify is the screensaver I miss most from the 95/XP era. I forgot about it until recently and have decided I would like to finally finish what little I started back when I was in school.

    With your permission I would like to take heavy inspiration (with citation!) from your color-shifting code in particular. :)

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.