Directional Blur + Tweener in AS3

Hello,

What is it?

Click here to see it… - click the background to execute the movement.

How it works?

User executes tweener for movement. Then the distance (between last update and current object position) and angle (directional vector of the movement) are calculated in each tweener update - so are the blur amounts - basing on previous object coordinates (from the previous update) - then the blur is appled to the object and current coordinates become the previous one so the whole thing can start again on next tweener update :)

I assume this is not the best method for this effect (senocular did this better using bitmaps in as2- but this method is slow and needs rewriting for simple usage. There could also be transparency issues with bitmapdata there). Anyways it looks far better than mine (the object leaves the trail and is not just blurred like in my method) but the method here works without the bitmapData and sports Tweener ;)

The source?

Sure! You can download it here :)

Quick Q&A:

Q: Can it be used with papervision in 3d?

A: Yep… you have to introduce Z to the equations and change the distance calculating function for one that would calculate it in three dimensions.

Q: Can I use it with multiple objects?

A: Yes you can! You can execute as many instances you want (and flash can handle;)) It uses the object reference so it can run many times on different objects simultanously.

Have Fun!

FLAIM

AS3 analog clock in 3D

Hi,

In the previous post I have presented how to create a simple analog 2d clock using as3 only.

Now it is time to do it in Papervision3D :)

I’ve used the same mechanism as in the 2D one - the polygon generator I’ve created serves now as a vertex creator - and basing on the vertex - cubes are added to the scene. Tweener is used for animating the cubes then. A simple mathematical mechanism is used for camera movement.

You can download the source code here. The source is well commented. All classes included.

Comments are welcome as usual ;)

Have fun with it,

FLAIM

 

Simple AS3 analog clock (2d)

clock_v1

hi,

Basing on the previous post (2d polygon generation) I’ve created a simple, ‘redrawing’ analog clock (in 2d).

Why complicate with polygons? Why not circles and lines from the drawing api?

- I wanted to have all the points coordinates (x,y) for later use with papervision3d. Drawing a circle using the Flash drawing API (graphics.*) will not give you such information.

Of course there are other methods to get the coordinates but this is probably the fastest one - additionaly we have full control of the number of vertexes we create.

How it works?

- The interval is Tweener based - it executes a function that gets the seconds/minutes/hours and then clears and redraws the polygons - once every second using a fake Sprite,

- polygons are drawn using the method from the previous post,

- entire clock is code based - no stage elements required.

The code

You can download the entire source here.

Have fun,

FLAIM