Archive for the ‘Flash’ Category
Apple, Adobe, and My Identity Crisis

The announcement of Apple’s modification to their developer agreement has been making the rounds and I’m sure most have seen it by now. It’s great news for Flash and 3rd party developers. The announcement for me however was all irony.

You see, around six months back during the CS5 beta I had spent quite a bit of time working with the iPhone Packager and building my first iPhone app. The process was arduous as I was struggling to keep my application’s performance at acceptable levels. The application is a generative art app (see images below) and I spent many long nights optimizing and eventually cutting some functionality, but in the end was happy with the little app I had built. I submitted to the app store and waited patiently for my acceptance into the iPhone development community. I waited. And, I waited some more. The day never came.

Spiralz

Shortly after my app submission Apple announced it’s change in policy. My general sentiment was that, “hey, it’s Apple’s store, they can carry the products they want.” That said, I was bitter. All my efforts had been wasted. That and the timing was certainly one of the least classy moves I’ve seen from a technology corporation, so full of spite. Apple was giving me the big middle finger so I was obliged to give it right back.

Fast forward to roughly a week ago. I decided it’s time to get back into iPhone development. This time, the Apple way. I put aside my grudge and decided I would give it another go. In my newly inspired journey I downloaded the latest SDK from Apple only to find that I couldn’t run it. I needed Snow Leopard. So I bought Snow Leopard. In all of Apple’s brilliance you can’t just simply download the install. I had to order a hard copy. Such an unnecessary waste of our precious physical resources. Tracking my package, everything was looking like it was on schedule until hour after hour passed with no delivery. Finally around 6 PM I see that the delivery failed. This was Friday. The new delivery date was Tuesday (per the holiday weekend). There was no way I could let this happen. First, I shot a frustrated email to Amazon. They refunded my shipping costs without so much as blinking, I was impressed. I then called UPS to see if I could pick it up that evening. After some struggling to reach a human I finally tracked down a number for the local warehouse and gave them a ring. They graciously told me I could come by after the driver returned (and after regular business hours) and pick up my package. Success! I will have my iPhone development and code it too!

After obtaining my package I ran inside, ripped it open, popped it into my mac, and let’r fly! Failure, I needed more RAM. My mac isn’t exactly the newest machine, but the thought to check the min sys requirements never even crossed my mind. I was defeated. The next day I looked into what kind of RAM I would need and how to crack open my mac to put it in (it’s a mac mini). RAM was fairly cheap. I would just have to order it and wait another couple of days. I live in a relatively rural area so I wasn’t expecting to find it locally, but on a whim I decided to check Office Depot’s site to see if they carry what I needed and if the local store might have it. Sure enough they did. Excitement rekindled and I was off to get a couple 1 GB sticks. The RAM install, while somewhat of a process, went off without a hitch and I was ready to go. I installed Snow Leopard, installed the latest SDK, and within a couple of hours was digging in.

I got right to it and started with the Cocos2D w/ Box2D template. This is some good stuff. Cocos2D, from what I’ve seen so far, is really well thought out. I dig the architecture, it makes sense. Scenes, layers, nodes, I can get down with this. It didn’t take long to get some rough ideas up and running. I downloaded Tiled and started creating a simple map. I experimented with Box2D’s features and had bouncing balls responding to user input, bouncing off of walls, and colliding with boxes. “Oh yea!”

Then comes the irony. Yesterday morning I get an email from Apple that my application has been approved. “Huh?” I was baffled, “How did this happen?” I considered the possibilities. Maybe all I needed to do was accept their new terms (which I did when I downloaded the new SDK). Or, maybe after doing so they re-reviewed my app and it somehow slipped through the cracks. Or, could it be, could they have changed their developer agreement to allow 3rd party apps? I had my answer shortly as the reports started to flow in. After all I’d been through I didn’t know whether to cry or rejoice. It was good news, but I felt that I had gone through a bit of an ordeal to invest money and time into using Apple’s tools. Oh well.

Anyway, I have an app up in the app store! It’s simple, yes. A novelty? Yes. But it’s fun to play with and it was built using Adobe’s iPhone Packager. So go drop a whopping 99 cents and check it out! Or, if you’re feeling cheap, shoot me an email and if I’m feeling generous and I still have some left, I’ll drop you a promo code.

Cheers

Well, what are you waiting for, go get it!

First Person 3D Engine

Wow, it’s been an amazing last couple of days with the announcement of Astro and all the hype around the new 3D API and the pixel shader language Hydra as well as some of the sneak peaks shown at Max. The community is in a rampant frenzy as speculation and confusion runs wild. Hardware acceleration, C++ getting translated into ActionScript, and Flash running Quake! It’s no wonder people are freaking out.

At any rate I figure now is a perfect time to make a little announcement of my own. Actually I confess, I already decided a few days ago was the perfect time when I posted this to the Papervision3D mailing list and John Grden is probably showing this right about now at Max. Never the less I decided this was worth a blog post.

I’ve been working on a Papervision3D based first person 3D engine. Below are a couple of screen captures from two different examples of the engine.

First Person 3D EngineFirst Person 3D Engine

Before you get too excited and run off to see the demos there are a few disclaimers that need to be expressed. First, you need a fast computer. I’m sorry, that’s just the way it is. Second, I haven’t implemented proper pre-loading so you’ll need to be patient and wait for all the imagery to load. Last, these demos are still a little rough around the edges.

Now for the controls…

Mouse click and move – look around
e – walk forward
d – backward
s – strafe left
f – strafe right

And the moment you’ve all been waiting for…

Demo 1
Demo 2

Thoughts are welcome and appreciated.

Enjoy!

Updated Fire Sphere with Source

There have been a few requests for the the source to the Fire Sphere demo I posted forever ago. I’ve finally gotten around to cleaning up the code and getting it to work with the latest rev of PV3D.

Fire Sphere

Liquid Metal

The material applied to the sphere is created using a static PNG with a DisplacementMapFilter applied to it. The DisplacementMapFilter uses a BitmapData object that has had perlin noise applied to it to give the flame effect. A lot of other effects can be created this way as well. Things like rippling water or clouds. It’s just a matter of changing the original image and tweaking the settings of the filter and the noise.

You can get the source here. It’s really quite simple. The whole thing is under 200 lines of code.

Enjoy!

A* 3D – No, really, it’s 3D

There seemed to be a little disappointment that my A* demo wasn’t actually searching in 3D. Maybe I should have called it A* visualized in 3D. At any rate I’ve revamped things and now have a demo that does search in 3D.

A* 3D

It wasn’t much of a stretch to get things working in the third dimension. The only thing I found particularly tricky was making sure that the path didn’t cut through a solid corner — move diagonally adjacent to a non-walkable node. Besides that everything was pretty straight forward. I also took the time to make sure the code was clean and at least somewhat documented. I haven’t bothered to try to do any optimization and I certainly haven’t put much time into splitting the functionality into proper objects. Nonetheless, here’s the source.

Note that you’ll need to add to your class path Away3D as well as Zeh Fernando’s Tweener w/ Bezier support which powers the animation in 3D.

Enjoy!

A* 3D

Path finding is hardly a new topic for the Flash community. For me however, it’s an area unexplored. While I’ve always found the topic interesting and enjoyed the demonstrations out there in the wild my direction has just simply never really taken me there. Instead I was probably reading about some agile development process or something nice ‘n’ dry like that. Anyway, as I’m now delving deeper into 3D and game development topics I’ve started experimenting with path finding. It’s quite fun and not really all that complicated. At least at the elementary stage that I’m at.

I’ve been working with the A* algorithm which uses heuristics to find the most optimal path from a start node to a destination node within a node graph. The algorithm has many uses, especially in game programming.

In my exploration I’ve combined the A* algorithm with Away3D to illustrate how an object could travel through a 3D environment based on a found path.

A* 3D

It doesn’t always find the best path. Probably something simple I overlooked. I actually find that this could be used as an advantage however. For instance, if this was a character in a game the less optimal path can represent a poor choice by the character giving it a bit of added realism. A thought anyway.

Flash Video in 3D – The Tutorial

Adobe launched my Flash Video in 3D tutorial today. The tutorial, geared towards intermediate developers, walks you through mapping video to a 3D mesh using Papervision 3D and includes source code.

Check it out.

Flash Video on 3D

Evident by the many impressive demos that are spreading like wildfire throughout the community, the open source Flash 3D engine, Papervision 3D, is taking the Flash world by storm. It’s interesting that Papervision caught on like it did considering another open source 3D Flash engine, Sandy, with many similar capabilities has been around for some time. I guess some things are just, before their time. At any rate, I encourage anyone interested in 3D to take some time and explore Papervision. It’s an amazing engine.

I myself have been spending a great deal of my free time getting to know the engine. It’s quite fun and I’m always awed by the fact that, this is Flash. My latest experiment involves streaming video. It was inspired by the great work done on The North Face Kiosk by close friends and colleagues, Darren and Tommy. During the development of The North Face Kiosk I never thought what they were doing with WPF would have ever been possible, with acceptable performance, with Flash anytime in the near future. I was wrong, take a look…

Flash Video 3D

There are obviously limitations with how far this concept can go but, I think what this demonstrates is promising. Flash has really come a long way and, as usual, it’s future is brighter than ever. The Papervision community is really pushing Flash and there are going to be many more great things to come.