Archive for the ‘Lab’ Category
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 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.