Posts Tagged ‘as3’

Mac OSX “Genie Effect” AS3 Class

October 1st, 2009

That’s the little AS3 Class I’ve written. Nowadays there’s some strange trend in ripping off OSX GUI, so I’ve decided to make your life a little easier.
I’ve been googlin for this effect, but I haven’t seen anything event close, to what you can see on OSX.

So here comes this little class – GenieFX:


Click grey button-like object to see the animation.

This is the fragment pulled from demo’s source:

addChild( gfx = new GenieFx(
( new demoBmp() ).bitmapData , /* object to animate - DisplayObject or BitmapData */
150                          , /* x position of genie's "tail" */
0                              /* start from hidden image */
) );

You can pass a vector shape or whatever else to animate.  The “x position of genie’s tail” is randomly generated after every button click,that’s why the image comes to and from different places.
Source for this demo is available for download here:
http://exp.teleranek.org/proj/genie/demo.zip

The demo uses almost all functions of this effect, so you will figure out how to use it : ) It’s ultra-simple.

The class uses a bit buggy ( but free to use on commercial projects : P ) tweening lib called “Twease”, feel free to change it to TweenLite or whatever else.

Tags: , , ,
Posted in flash experiments | Comments (9)

Papervision3D 3D Fonts

May 25th, 2009

I wrote today a little class which converts font outlines to TriangleMesh3D objects:

Click on the image, you will se a demo. I wasn’t tweaking my code too much, so there are several bugs in this 3D fonts class. Major bug is, that glyphs like “i” or “%” aren’t rendered properly. And it doesn’t work with all typefaces, hence this demo is based on only one typeface ( helvetica bold italic ).

And don’t exaggerate with typing your own phrases in the input textbox – I wasn’t optimizing my code, so CPU usage can be high.

Tags: , , , , ,
Posted in flash experiments | Comments (0)

3D Physics papervision photo gallery

November 17th, 2008


This is the 3D photo gallery which uses WoW Engine 3D physics to simmulate movement of thumbnails. I believe I could do some precaching or modify WoW to make it a little faster. But up to now nobody complained:) Some issues with interaction and feel are to be fixed.

I’ve updated my old flash portfolio ( http://teleranek.org/fl.php ) to display properly in Firefox under Mac OS

[ update: minor update to photo gallery: bigger titles, less dynamic movement of photos, blurring, and several other enhancements. I will be updating this gallery till it gains satisfying level of “usability”  ]

[ update2: blah, i forgot to give a link to the gallery :d now it’s fixed. Click on the image to see the gallery. This is my gallery with different images: http://szarakpl.teleranek.org ]

Tags: , , , ,
Posted in flash experiments | Comments (4)

Rotating rings with shadows and reflections and a pv3d primitive

September 10th, 2008

I have made this two simulations of rotating rings. First one, is a bit more interactive – you can change position of the camera by dragging mouse cursor. Second one is fully prebuffered, thus you can only click on stage, and watch how the rings are rotating.

Shadows and reflections were made using Andy Zupko’s classes ( blog.zupko.info ). They were also tweaked to look like projected on convex surface.

First demo is a cpu killer, despite some modifications, and prebuffered shadows ( after prebuffering, shadows are animated on the floor plane ). On 1Ghz it will probably have something around 10fps. I could lower the details, but this demo is all about details:)

Second demo is also a cpu killer, but only during the prebuffering phase. It has some details smoothed, and features two animations, chosen randomly after clicking on stage.

To make this demo, I needed genereric model of a ring with proper texture mapping – so i modified cylinder primitive from Papervision3D. To make a new Ring:

new Ring( material , radius , height, subradius , segmentsW , segmentsH , topFace , bottomFace )

material – its for example new ColorMaterial( 0 )

radius – radius of a ring, including wall thickness

subradius – thickness of ring’s wall

segmentsW – more segmentsW, your ring will look less angular

segmentsH – segments horizontally.

topFace , bottomFace – if you dont include topFace and bottomFace, your ring will look like two extruded circles.

You can download this class here to make your own rings ( of course you need Papervision3D too )

ps. I had to disable comments because spambots seems to like this post. Gosh, I hate this lamers who call themselves programmers and writes shit like this…

Tags: , , , , ,
Posted in flash experiments | Comments (5)

Fluid morpher

July 15th, 2008

Recently i’ve written a class to morph a DisplayObject into any other DisplayObject. It morphs these displayobjects by simulating fluid-like substance. Here’s a little presentation:

Tags: ,
Posted in flash experiments | Comments (10)

Bayesian net Artificial Intelligence sim

July 15th, 2008

I’ve decided not to add this project to my portfolio, because it’s more complex and needs some words of explanation on this blog. It’s main purpose is to simulate different algorithms used in AI programming. It does so, by applying bayesian nets to agents ( cube-like robots ). Each agent as it is seen on simulation, eats little blue cubes. They have 3 states of hunger – 3 = not hungry, 2 = hungry, 1 = v.hungry. Each robot can shoot, but shooting makes them more hungry. Robot shoots towards his oponent only if the oponent is in robot’s range of sight, and if the robot isn’t very hungry.

When food and enemy isn’t visible to the robot, robot simply walks around doing nothing. Each robot has its bayesian net which decides what to do – shoot enemy, eat , run from enemy and shoot, and so on. You can tech your own robot, by clicking “add human” and eating or shooting by yourself. Then, when you click “learn”, AI takes control of your robot and tries to imitate your moves.

Button called “decrobo” places new robot driven by decision network. It takes time to learn for the first time.

Tags: , , , ,
Posted in flash experiments | Comments (1)