Motion Tracking and Papervision

A couple of days ago I posted my first attempt at motion tracking in AS3 using a webcam and promised that I would play a little bit more with it. Well, I got a little bit anxious and before refining the tracking code I decided to put it to use.

You may have seen the video of head tracking using the Nintendo Wii. That video inspired me to try my hand at the same concept using Flash, Papervision 3d, and my newly discovered love for trying to get motion tracking / facial recognition into Flash.

Motion Tracking and Papervision

As such, I have created this example which is my first step in creating some sort of tracking interaction with a 3d scene. if you would care to see a little bit more detail about what is going on, hit X to see the video and W to see the framerate. Stay tuned for more updates as I update the tracking code. Once again, I will post the source when it is a little further along.

** please note that you require a webcam to take advantage of the motion tracking, if you do not have a camera the scene’s camera is simply controlled by the mouse.

Webcam Motion Tracking Fun v1

I have been doing some recent experiments in ActionScript 3 so I thought that I would start posting them. Most of my recent work has been client work using Papervision, but I found a little time to play with my webcam over the weekend.

I have a couple of uses planned for this and will post them when they are done but here is the first iteration.

[kml_flashembed movie=”” height=”240″ width=”320″ /]

With the help of a diff equation from Forrest Briggs, I managed to capture the specific area of movement within the webcam frame. I will continue working and post source once it is complete. This little project is helping me understand the workings of the bitmap data objects in as3.

FITC – Adobe Keynote

I am just sitting down to watch the Adobe keynote at Flash in the Can in Toronto. Mike Downey is currently running through this. So far he has covered features of Adobe Air and shown demos of QVC and Nickelodeon which show some of the capabilities.

He then moved on to talk about Flex Builder 3 and it’s capabilities, one thing that I didn’t know about was the Flex Component Kit for Flash CS3. It is a toolkit that lets you create content in the Flash CS3 IDE and use it in Flex as a Flex component. I am not very well versed in Flex but I was definitely curious about the options that I had as a Flash IDE user.

Now they are showing us a demonstration of the features of Kuler and all of its strengths. This part of the presentation seems to not fit in very well with the flow of all the presentation content. The only real tie-in is that they are showing an Air app.

Flash Diesel is up ! They are starting off with the showing the new object based animation engine that does not use a timeline. It is the same thing that was shown at MAX and Flash on the Beach last year (, but impressive just the same. They just unveiled a new track-view feature which allows for much greater/easier control of animations.

Up next is the IK part of the demo where they are using a bones tool to add bone structure to movieclips. This is something that I haven’t seen before, they have a quick option to enable bone manipulation at runtime…. very slick.

The ability to manipulate items on the stage in a 3D style has been added to the Flash IDE. There are going to be new controls and capabilities to work with items in a 3D style, the new controls are able to manipulate images and apply things such as tweens to them.

They are now onto Hydra (AIF Toolkit) which is an image processing language, if you would like more information you can check out the info at the Adobe Labs AIF Toolkit site, it can give you much more information that I can. One new things that they are talking about right now is the ability to work with files in the browser without having to send anything through the server. They have added the ability to take something at runtime and save it to your system without having to do a round trip to the server.

Well, that is all for the keynote. I was hoping to see something about Thermo but I didn’t catch anything about it. I did show up 10 minutes late and may have missed it.

Colin Moock on AS4/ECMAScript 4.0 at FITC

The standards talked about are not slated to be implemented until at least december 2008.

You can see Colin’s notes from his presentation at the following address:

Here is a summary of what he covered in his talk, this is all covered in the link above but I thought that I would just post the items that interested me the most:

Structure Types
– record type
easier way to create custom object types, instead of using classes
– array type
ability to apply types to elements within arrays
– union types
gives the option of assigning one of several datatypes to a variable
ie: var x:(int|string) // x must be either an int or a string

Type changes:
It looks like byte, uint, int are being removed from ECMAScript but they will most likely stay in AS for the time being.
There are a series of new lower case types including string, number, and boolean
There are going to be non-nullable types that cannot be assigned the value of null, the idea is to save time in type catching.

Lexical block scoping lets you create variables without var, it allows you to create assign values to variables within code blocks. Check the lecture for an example, it looks like it would be useful if you have a temporary variable.

You will have the power to create single line functions in the same way that you can currently create a single like conditional statement.

!!= can be used to shorten variable assignment, can turn myVar = myVar || “default” to myVar !!= “default”

Type casting can be done using the operator “cast” ie: food cast Apple

Switch type can be used to test the type of variable in a switch statement to allow for multiple types and custom functionality for each

String indexing looks like it may be a little useful, you can access characters in a string the same way that you would access items in an array “test”[2] would produce “s”. Similarly you can use slice on a string to get a range of characters quickly.

Thats all for now.

Essential Actionscript 3.0 – Colin Moock

Essential Actionscript 3.0So, in light of the fact that I am going to be taking the Papervision 3d workshop in Toronto in about 10 hours, I figured that I would finally finish reading Essential actionscript 3.0. I have been trying to find as much time as possible over the last month to get through this wonderful book but haven’t had nearly enough. Turns out that a 4 hour flight from Calgary to Toronto was just what the doctor ordered.

I am forever in debt to the authors of such books and forever in awe of the knowledge that certain people have. This book showed me just how much I am behind the world of Actionscript and how much I have to learn viagra generico pre├žos.

I can only hope that with what I know now about coding and what I am learning over the next little while I can really learn to harness the power of Flash and start creating things that are exciting. This book has given me a very strong AS3 foundation to work from and I hope to be able to work on as many AS3 projects as possible so that I don’t lose any of what I have learned from reading through it.