Archive for the ‘Actionscript’ Category

Open Microphone pt 1

Published by Ronny on September 25th, 2009 in Actionscript, Community, Flash. No comments

mikerophoneIf you’ve come by here a few times you know I have been experimenting with computeSpectrum and webcam motion detection. At a given moment I wanted to combine the 2 of them in order to use voice commands in order to make stuff happen on the screen. That would be pretty badass, right?

However I soon learned the microphone feed didn’t go through the SoundMixer of the Flash Player, therefor would would not be able to be analyzed. There was a workaround with FMS/RED5 and bouncing the stream off the server but that’s rather overkill (not to mention the lag). Read the rest of this entry »

Bezier animation fun revisited

Published by Ronny on September 7th, 2009 in Actionscript, Open-source, download. 1 comment

A few months ago I experimented with Bezier Animation and allthough I uploaded my SWF files and shared them, I never really shared the source. This is what I wanted to do a few days ago when I thought “Oh, what the hell… Let’s clean that code up before uploading it…”.

So I started moving some code around and after a few minutes, I found myself rewriting the whole thing… That’s not a bad thing since now we’ve got one handy class that can do about just everything a Bezier Animator should be able to do. :-)
Demo time!

Bezier Animation Demo

There’s still a little bug somewhere which allows the target to ‘run away’ from the bezier, and I haven’t gotten quite to the root of the problem, but I really felt I had to share this. Also there are some imperfections when you disable the orientToPath and scaleByPath properties. I will look into fixing those asap.

I really love the idea of animation movieclips using bezier curves. It looks so natural and yet zo intriguing… I will do some experiments and upload them later on, showing the coolness behind this simple animation engine.

Sources
Download the above demo source (Flash Builder 4 project): Click
Download the BezierAnimatioin class: Click


Bezier animation fun!

Published by Ronny on March 3rd, 2009 in Actionscript, Experiments. 9 comments

Last week I went to FITC in Amsterdam. It was great! I had such a great time. I met a lot of intresting people and although Amsterdam turned out to be quite expensive place, I really liked being there a few days.

During the conference I attended Joshua Davis‘ session which really inspired me. I’ve never seen Joshua Davis present, nor did I know his work. Let me be as crystal clear about this as I can be: The man is a freakin’ genius!
During his session he showed a few demo’s of bezier animated stuff. I felt like trying that myself, and this is what I came up with.

The basic concept is to create a bezier in Actionscript and animating movieclips using the bezier as its motion path.

  • Basic principle (this is actually just a basic pentool (without the option of adding new points :-P ))

The following versions use the same concept as this one, except instead of fixed anchor points, they all use random points defined in 2 planes. This makes a bit of variety possible allthough the main animation stays the same and that’s absolutely cool!

I added a few keyboard controls to give you some control of what is happening

  • spacebar = show the handles
  • r = clear the bitmap
  • p = pause the animation
  • n = randomize handles
  • b = blur more

World360: Unbugged and kicking!

Published by Ronny on February 20th, 2009 in Actionscript, Experiments, Flash. 2 comments

A few days back, I posted the latest update on my World360 project (aka ‘stereographic projection‘… That’s what it is actually called). What this thing actually does is it turns a 360° panorama image into a stereographic projection. The idea is to render this real time (just for the fun of doing it) (I am thinking about doing more with this though…)

stereographicprojection

A few days back I ran into a (at that time) weird problem where transparency was rendered black after a few frames. I had a hard time figuring out what was going on, and I just didn’t have a clue where to start looking. Google wasn’t really helping me out either. So I posted my problem on FlashFocus but nobody came up with the answer to my problem. Peter Elst asked Ralph Hauwert if he already had run into this problem. Mario Klingemann suggested that there might be a problem with the premultiplied alpha. At that time I didn’t know what premultiplied alpha was and seen as the problem resembled the example Mario gave, it seemed quite obvious he was right.

So I took peace with this, and decided to fall back to a non-transparent image format like JPEG. 2 days later Erwin Verdonk came up with the answer to the whole problem… I just had a hard time understanding it…

The root of the problem was me: I had totally forgotten that the draw() method of the BitmapData class didn’t clear the pixels before drawing… Yea, that’s emberassing, right?

But okay… That took care of some problems. I rewrote some of the code, and adjusted some settings.
The speed and the result are quite okay right now. However using 450MB and up of RAM usage might be a bit of a killer.
I’m wondering if I could take care of this using PNGencoder or perhaps JPGencoder.

But for now I’m happy… The final result (for now) can be seen here.

Thanks everybody for helping me out. You guys rock!

PS: The picture used in this experiment was taken by Thomas Heylen. Thanks Thomas!

World360 update, now with PNG bug!

Published by Ronny on February 14th, 2009 in Actionscript, Experiments. 10 comments

Yesterday I decided to get back to my so called ‘World360′ experiment. I wanted to speed up the pre-rendering engine. I managed to do that, with some amazing results: Up to 3 times faster overall. Peaks of 800% speed gain!

You can view the previous version here.
The latest version can be viewed here.

I’m very happy with that, but there’s one little problem. I started to notice a very ugly black border around redrawn PNG transparency (which happens when the animation is pre-renderd).

Result without redrawing bitmap

Result without redrawing bitmap (aka: real time rendering)

Result when redrawing the bitmap

Result when redrawing the bitmap (aka pre-rendering)

Read the rest of this entry »