Saturday, January 21, 2012

Alpha 2 released!

I have released the second alpha of the SWIFT/Lightningbeam project! This release brings several new features, such as:

  • Full cross-platform compatibility: runs happily on Linux, Windows and Mac OS X without any dependency installation necessary
  • HTML5 vastly improved: framerates within 10% of Flash's, and a large subsection of ActionScript working
  • Shape drawing: Straighten and Curve modes are now usable
  • Text added (although you have to set the contents with ActionScript right now)
  • More forgiving of non-fatal errors, so you don't lose work if I make a mistake
  • And more!

Tuesday, January 10, 2012

RENAME - and Alpha 2 announcement

What happens if you Google 'swift'? There are half a billion results. Mainly this is because it's such a common word. But I also wasn't the fist person to use it to refer to Flash software: Electric Rain introduced the Swift 3d plugin for Flash nearly 3 years ago. So I have decided to rename SWIFT to Lightningbeam.

Why Lightningbeam?
Lightning is the most dynamic thing encountered in nature, leaping miles in a fraction of a second. Lightning contains enormous amounts of power; the average lightning bolt produces 40 petawatts, or the equivalent of 100 million coal power plants.
But lightning is also known for being very hard to control. Thus, the beam indicates a focusing of this energy. It is the goal of Lightningbeam to provide users with this power for creation of animated content.

The second alpha of the SWIFT/Lightningbeam project will be released shortly. Along with the rename, the project has undergone a complete re-write from the ground up. This was allowed me to use a simpler object-oriented system, which made drawing and exporting simpler and more efficient, and to use a better GUI system for cross-platform compatibility.

Summary of notable changes:

  • Project renamed to Lightningbeam
  • Code re-written
  • Cross platfrom: runs without any installation on Windows, OSX (x86, x64, and PowerPC) and Linux (x86, x64, PowerPC and ARM [untested - awaiting screen for my BeagleBoard]). Further ports are in the works, such as a web app.
  • HTML5 animation runs much faster (it's actually usable now):
    Old version3-8fps0.3fps
    New version50+fps40+fps
  • HTML5 code re-factored to run ActionScript methods natively (in progress)
  • And more that I can't remember off the top of my head.
It is still in heavy development, and I haven't completely finished re-implementing methods (such as movie clip creation), but I will release the alpha 2 when I have. In the mean time, I will be moving this blog to

Tuesday, October 25, 2011

Progress report

There isn't really anything new to see yet, but a lot is going on under the hood, so I figured I would make a post. The cross-platform GUI is working out (I already have an Android port), and in addition there are several useful features that were conspicuously absent from the last release (such as independent line and fill colors, paint bucket and layers).

Tuesday, October 18, 2011

Aha! Object-oriented programming!

Well, I didn't intend to rewrite any of the internals of Swift, only the GUI interface. However, now I see that I should have been using objects all along instead of nested dictionaries. The rewrite makes it vastly easier to use. Consider this snippet:
This now becomes:
A bit more concise.

Monday, October 17, 2011

New system almost complete - much more stable

I have mostly finished the framework underlying the second release of SWIFT. I have made a wrapper around most of the windowing functions I need, plus drawing functions which are now handled by the GUI library (which should allow me to make a Clutter backend as well!).  Instead of using the buggy pixel-based hitTest I was using before, I am now using the even-odd algorithm. I was initially calculating exact intersections of lines, but I stumbled across this post, which appears to be much more efficient. Early tests indicate that it is. I ran a benchmark; here are the results (from an Asus EeePC netbook!):
10,000 hitTests
total time: 1.735355 seconds
average time: 0.000174 seconds/hitTest
In other words, that's about 0.1 milliseconds per hitTest! This is better than I expected by a factor of 10 or more! And it all "just works", unlike the pixel version which was very finicky. So (judging by hitTests alone) you could be working with 1,000 objects on the Stage and not even notice a slowdown on a low-spec'd computer!
I will re-write the HTML5 hitTest library to use this algorithm, it should speed it up quite a lot.

Thursday, October 13, 2011

Re-writing SWIFT from the ground up

Most of my problems with SWIFT come from the interaction with PyGTK and Cairo. These are also my major source of pain in platform ports. So I have decided to abstract the GUI library so I can use GTK on Linux, Cocoa on OSX and whatever on Windows. This also lets me fix all the crude hacks I did to get input to the right place. However, this will mean a nearly full re-write of SWIFT (only the object processing functions can stay untouched). Time to get cracking.

Tuesday, October 11, 2011

OSX Working!

I finally got it running on Mac OSX! It is not a one-click setup, and Gnash doesn't run, but it is a start. I will keep working on it and hopefully I can offer a package soon. For installation instructions, see