Archive for 'Flash'

Flash Motion Blur Sprite Source

I’ve finally found some time to clean up my MotionBlurSprite source and make it interchangeable with Flash’s Sprite class.

Features

  • Almost completely interchangeable with Sprite class (see caveats).
  • Ability to specify blur by angle & distance, or by vector (dx, dy) – the latter is perfect for blurring based on the sprite’s velocity.
  • Transforms (rotate, scale etc) affect the filtered sprite, unlike normal Flash filters which are applied after transforms.

Caveats

  • No mouse interaction with children, although I’m planning to add child mouse interaction in future.
  • Sprite size is limited to Flash’s maximum bitmap size of 2880×2880.
  • Need to call blur(), blur2() or update() after changes to graphics or children. It’s best just to call the relevent blur() method on enterFrame after all other updates have been made.

I’d love to know if you use this class in your project – please let me know.

Download MotionBlurSprite_v1.02.zip

Here’s a basic demo of the class with angle and distance controls and the ability to add/remove children and draw to graphics on-the-fly. The standard Flash Sprite is on the left and MotionBlurSprite is on the right. The method calls to add/remove children and draw graphics on both are identical. Thanks to Keith Peters for his awesome little MinimalComps UI components – very handy for things like this.

Motion Blur Demo

Sony Quantum Code Award Wrap-up

This will be my last post on this – I promise. :)

While at my previous role at Massive, I had the privilege to work with some incredibly talented people on some fairly heavily-awarded projects, such as V8 Supercars, the Sydney to Hobart Yacht Tracker and the BigPond Movies Viiv application.

After leaving Massive I didn’t think I could top that, but one of the first projects I worked on at Euro late last year has come pretty close. Here’s what we’ve picked up to date (I might be missing a few more):

Awards

Nominations

Water For Life Microsite using Papervision3D

Water4Life Homepage

Euro has just launched an integrated campaign for the NSW Government called “Water For Life”, which aims to inform the public about new water sources, and ways in which we can use our existing sources more efficiently. The campaign presents a “day-in-the-life” view of a water drop’s journey through our water system, and includes TV commercials, printed and online advertising, and a microsite.

The aim of the microsite was to unify the journeys presented in each TV commercial, and provide a little more depth of information without becoming too heavy on details. We wanted to reuse and maintain the visual style of the TVCs, with the almost anthropomorphic focus on the water drop itself, so we decided to build a set of 3D scenes where people could discover additional information on water efficiency at various points on the drop’s journey.

Water4Life Bathroom Scene

We used Papervision3D to render the scenes, which were partly modelled in 3D Studio Max and textured using a combination of texture-baking in 3DS and plenty of post-production in Photoshop. Then additional elements were added directly in Papervision, such as the refractive water drop, depth-of-field particles, tree decals, skyboxes, lens flares, etc.

Water4Life Map Scene

I’m really happy with the final result, as well as the performance of the 3D scenes thanks to some optimisation tricks and techniques. I’m planning on doing a series of posts going into further detail on some of the effects and optimisation techniques, including source code where possible. If there’s anything specific you’d like me to cover, leave a comment.

Easter Egg a Bastard

A couple of weeks back just prior to the Easter weekend Euro RSCG launched another campaign for the Australian Democrats. Called “Easter Egg a Bastard” – pick a politician’s website, or enter your own URL and then egg the page.

easter_egg

I’m happy with the way I’ve seamlessly combined timeline animation with scripted animation. The bunny and egg are controlled using timeline animation right up until the egg hits the slingshot pouch. From then on it’s all ActionScript.

The timeline animation is triggered from ActionScript using good old gotoAndPlay(), and when each animation finishes, the bunny’s timeline calls stop() and then broadcasts an event back out to the view class controlling the bunny. The bunny SWF is embedded at compile time which would normally cause any ActionScript to be stripped out, so I used this method of preserving timeline code in embedded assets. Read the comment on that post though – I also found that waiting one frame often wasn’t enough. I simply added a check for the existence of loader.content in the enterFrame handler before continuing.

I also love the feel of the slingshot physics – it took a fair bit of tweaking to get right. The feeling of depth as you pull back on the slingshot is faked. No Z dimension – the pouch & egg are just scaling based on their Y position. This meant that I didn’t need to do any converting back and forth between 3D and 2D coordinates to draw the rubber strips. Once the egg leaves the slingshot however, proper 3D takes over and the egg is positioned & scaled based on its Z coordinate. When budget or schedule (or both!) are tight, it’s essential to keep things simple and not over-engineer.

Quantum Code Nominated for a Webby

Another (potential) success for Euro & Sony’s Quantum Code campaign – nominated for a Webby in the Integrated Mobile Experience category.

You can choose your pick for best of the Net by voting at the Webby People’s Voice site.