Archive | October, 2008

Bezier drawing with Degrafa

22 Oct

I’ve made a couple bitmap-based drawing programs in Flash/Flex and figured it’d be fun to make a Bezier-based drawing tool as well. Thinking it couldn’t be too hard, I set out to see what already existed of code out there. I found a couple good resources, but boy was I wrong. Bezier math is kind of complex, at least for someone with limited math skills as myself.

I read and searched and then I saw somebody commenting “Why don’t you just use Degrafa?”. I’ve always thought of Degrafa as a Flex only thing, but Flex is really just a powerful abstraction layer. It’s all Actionscript and so is Degrafa. The more I read in the Degrafa source code, the more I loved it. Degrafa has really good classes for both Cubic and Quadratic beziers that you can easily use straight from AS3. Here’s my first take on this (right click to view source):

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player

I’ll eventually extend this further to a full, but basic drawing program. I’d love some comments on the way I’ve structured this, so if you got the time… thanks! If you want to do anything related to programmatic drawing, make sure you check out Degrafa. Loads of cool stuff you can do with it!

Playing with vectors

14 Oct

Experimenting with vector drawing today. As I’ve done a couple bitmap-based drawing programs earlier, I figured I might as well have a stab at making a vector version also and while playing around, I made this. Looks kind of pretty, doesn’t it?

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player

(Move the mouse above the SWF to make it run)