Archive for the ‘flex’ Category

Working on 3d text generator with papervision3d

Tuesday, October 14th, 2008

It’s no secret I have a bit of a fetish for playing with text and making text effects in flash. Back in May I decided to create dynamic 3d TriangleMeshes from BitmapData captures of text in textfields. Like the majority of my experiments, I never finished it.

I’m now posting this for three reasons:

  • Aral Balkans Grab the low hanging fruit Presentation which I saw last month in Ghent. I didn’t agree with everything he said, but what stuck with me was : “Talk about stuff you’re working on”. The idea is, if you wait forever for your “perfect finalized grand hobby project” release, it’ll never happen. You need peers to egg you on. So, I’ve been doing this on and off for a while and this post is an experiment to see if I’ll actually get a finished product out someday
  • I saw a post about 3d text with Away3d a few weeks back.
  • Just the other day, Mark Barcinski posted this on the Papervision3d mailing list which is pretty much exactly the process I had come up with. Doh. Somebody always does it before you… I’m just waiting for some Zupko or Ralph to see this and say : “oh, I typed that with my toes back when the beta of player8 came out…” ;)


Click here to try out the current state of my 3d text test tool

screen shot of 3d text testing tool

I won’t post any code for now as it’s in an embarrassing state… just getting shit to work eh. The current state of the algorithm only handles Pixel fonts with no diagonals or curves… The flow is:

  1. Take a BitmapData snapshot of a textfield with one character.
  2. Create “monochrome” bitmaps of the character, and any “holes” or shapes within it (That would be the black bitmaps at the bottom right of the screenshot above).
  3. “Scan” these monochrome images for a list of all the “shape edge” pixels.
  4. Optimize the “shape edge” points into lines, diagonals and curves. These are the “outlines” at the top left of the screenshot.
  5. “Triangulate” those points (this is not quite perfect yet, just punch in “B” into the input field for a fix of teh fail). This will generate the bluish patchwork letter to the right of the outlines.
  6. Use the triangles and the outline points to generate faces and vertices, UVMap them, pass a material and render.
  7. Feel intimidated by the bugs :D

Next steps are obviously to create some code that’s actually usable. Get the diagonals and curves to work. Try this out with some shaders, the 3d render is crap now. Get full words out. Animate the individual letters. I’ll need some help with optimizing some of the “mathier” parts, but that’s what the mailing list and friends like David are for ;)

Damn you Aral… I’m never gonna get this done :D

Verlet integration polygons with collision

Thursday, October 9th, 2008

I REALLY didn’t think it was gonna be this easy… no complex maths, just a bunch of looping and hitTest, hitTestPoint kind of code :)

Click for teh Collidin Verlet integratin kick butt multicolored polygons explorer demo

screenshot of colliding polygons application

While coding, I was sure I would roast my cpu, maybe run up to 20-30 polygons, but my trusty laptop can churn out 70 shapes at a time before the framerate starts to slowdown. I find it mesmerizing to watch… Cool with 70 shapes, but also very cool to watch a fewer number and actually appreciate the “realism” of the collisions (not perfect, but not bad). It’s late, the code is dirty, time to shut down and watch heroes :D

…but if you want the dirty source code, ’tis yours

More to come… am really enjoying this… :thumbsup:

Playing with Verlet Integration

Thursday, October 9th, 2008

Keith Peters presentation at FOTB was on the last day, at 9 am. Not necessarily the best time for “Advanced AS Animation” :D I was wide awake though, as soon as he started talking about Verlet Integration. The presentation slides are up on his blog. Keith also provided this gamasutra link for more info.

I was compelled try it out. It’s like magic, such simple math, yet, the result looks like the work of a physics genius! Here’s my first test : The Verlet Polygon Explorer

verlet polygons explorer screen shot1

It’s a Flex project, I added some widgets to make “playing around” easier. You can change the number of shapes, change the force of gravity, the “rigidity”, even add some wind and bounce the little bastards…


verlet polygons explorer screen shot1

verlet polygons explorer screen shot1

This really is a powerful approach in terms of performance. I only started to drop below 30 frames per second after 70 shapes… Naturally, “rigidity” adds a lot of overhead (number of times each “update” is calculated per frame).

Click the link above or images for the demo, source files can be downloaded here.

I’ve got a bunch of ideas for stupid experiments, but also for some real applications… This is a great tool to add to any flash developers bag of tricks! Thanks Bit-101!

360Flex wrap up

Friday, April 11th, 2008

Thursday morning, just as I was about to press “publish”, my swisscom *cough*RIPOFF*cough* connection CUT OFF. So, one day late, my highlights:

Sunday

  • Step off the plane, get immediately ripped off by some dodgy taxi, good start! (When I say ripped off, I mean an expensive, yet scenic drive through Milan instead of the 5 minutes it took me on my way back :swear: )
  • Arrive at hotel just after dinner was finished, but in time to meet the organizers and some of the guys. I think the ‘open mood’ for discussion (which prevailed the entire conference) kicked off here.
  • Played a game of pool at the hotel bar… The Finnish/French alliance (Cyril and I) pretty much pwned and humiliated the Flemish/Italian one (Koen and Marco ) :pirate: Good Times

Monday

  • After the keynote I saw Michael Labriolas “Dense and Hot: An Introduction to your applications start up”. I had read some rave reviews about his presentation in Atlanta, and the session (to be honest) did get me quite Dense and HOTT :ooh: . I’d say it was the most entertaining presentation of the entire conference, but also amongst the most informative. Michael put some fairly complex ideas into easily digestible slides… thumbsup!
  • I also saw Marco and his Colleague Mattia give a talk about the combination of Flex and Ajax. Ajax isn’t really my cup of tea, but connecting to the html/js side of things is necessary from time to time. I found this a useful and well prepared session.
  • Following the sessions, I spent the rest of the day in my hotel room, polishing up my own presentation. And when I say polishing up my own presentation I mean working on one ridiculous example… ;)

Tuesday

  • My own presentation. I was quite happy with what I had prepared, I had already test driven it once at nascom. What I wasn’t ready for was the 600×400 resolution on the beamer :D With awaiting eyes on me, live, I actually edited y positions of display objects to make my examples somewhat intelligible. This kind of screwed my flow, but I got some positive feedback later on so I guess I managed… like I said, anyone can deliver slides, it takes a REAL MAN to jump back and forth from Powerpoint to Flexbuilder, and actually do some coding in between :D. Thanks cyril for the photo (above)
  • If I felt bad about my troubles, such feelings quickly vanished while enjoying Neil Webbs Cairngorm presentation. Neil had no technical difficulties. As a matter of fact his presentation was quite brilliant, and very very funny, only, it seemed I was the only one laughing at his jokes :D Truly, I’ve never seen such good humor fall on deaf ears… cultural differences I suppose :D
  • Tuesday night was well spent at the hotel lobby. They stopped serving drinks, but the conversation flowed… I don’t think I’ll ever forget Tomislav Pokrajcic and his “Croatian Saying” ;)

Wednesday

  • I was disappointed by the cancellation of Ivan “the Mars Spider” Zambanellos presentation. With a name like “Mars Spider”, who wouldn’t be disappointed? This was easily made up for by Rostislav Hristovs presentation about SWFAddress. I will certainly be looking at SWFAddress and his examples again, particularly the wordpress example. And, thanks for the T-Shirt!!! :)
  • In the afternoon I checked out Christo Jolif talking about the ILOG Elixir components. It was very nice to see him do some live coding. The products are rock solid. A little expensive. But rock solid.
  • Dan Thomas was The final speaker of the conference… This turned out to be a fantastic presentation. It started off with Dan just listing “best practices”. I’m not sure if it was 100% intentional, but the presentation turned into a kind of an open forum, lead and moderated by Dan. Lots of great input from Neil, Robin, Michael and Sam

As promised, my slides and examples can be downloaded from here (warning, 16 megs, apologies for not optimizing my ppt images).

HUUUUUUUUGE thanks to both John and Tom, you guys ROCK!!!

All in all, I learned a lot, made a lot of new contacts and I hope to see all of you again at random occasions at random locations :buttrock:

Speaking at 360Flex Europe: 7-9 April 2008 Milan, Italy

Friday, January 18th, 2008

I’ve been listed on the homepage for a while now, I finally penned the “blurb” to my presentation which is :

Invalidation Routines, Pounded into your cranium once and for all!

The Flex Framework Invalidation Routines are a core tool in a visual component authors kit. This is a relatively small topic, yet, one often skimmed through, frequently misunderstood, or worse, entirely ignored. This presentation will go through the basics in a comprehensive manner, then dig deeper into the details and follow up with several real world examples, with an underlying emphasis on the common battles between designers and developers. The goals are to appreciate the mechanism, how and when to use it, and furthermore to understand where things can go wrong. “Invalidation Routines, Pounded into your cranium once and for all!” is targeted at developers dealing with visual components, from entry to mid level, but will hopefully also contain some gems for the seasoned veteran.

flex360 italy logo

I have to say I’m really looking forwards to this! The topic might sound a little dry (what flex topics don’t? :D ), but I’ve already got a bunch of ideas to liven it up and hopefully produce a memorable presentation. The reason I picked the topic is simple: Flex has people coming from the developer world and from the flash world, the invalidation routines are alien to both :D It’s not rocket science, but a ‘must know’.

See you there :)