New example by accident
This is what came out as I was testing to implement a custom renderer in my engine (The sources are available in the google code repository).
Posted in 3D, Experiments, Flash 9, Source | 3 Comments »
This is what came out as I was testing to implement a custom renderer in my engine (The sources are available in the google code repository).
Posted in 3D, Experiments, Flash 9, Source | 3 Comments »
Good news everyone! I packed everything together, cleaned up a bit and created a google.code project for my 3D engine. Since it became popular under the name ‘nulldesign’s 3d engine’ I call it ND3D from now on ;). I will post additional infos, more examples and future developments here in my blog and on the project page. So long…
Posted in 3D, Actionscript, Experiments, Flash 9, Source | 6 Comments »
About some time ago I started to code my own 3D engine in flash. Derived from a small AS2 project, I challenged myself to built my own flash 3D engine. So I took out my good old Actionscript Animation Book and opened the 3D chapter. Very soon I could move a cube around. A few pages later I learned how to implement simple dynamic lighting. The next challenge was to get texture mapping to work. Since flash still can’t distort images, you need a workaround. After I found these great examples: Seb Lee-Delisle’s flash texture maps and Andre Michelle’s texture examples it was done. Somewhere inbetween I switched to AS3, which was quickly done. Meanwhile Papervision3D became very popular and I thought it didn’t make sense to continue evolving my engine. But since I came so far, I needed to find out how to implement a few effects like depth of field or additive rendering ;)

My engine shouldn’t and doesn’t compete with Papervision3D or Sandy3D, nor it has a very user-friendly API, no stunning effects or animation support, but I learned a lot while building it, understanding 3D to 2D rendering, optimizing the code for a few ms of extra speed (AS3 rocks!) or challenge problems with 3D rotations like gimbal lock and their solutions: quaternions. It’s just another 3D flash engine, at least I can say: I made it! ;)
It’s undocumented, there’s still a lot of work to do and it doesn’t have a cool name , but if you want to play around with it or just take a look how I set up this and that, feel free to download the sources (yes, the 3D ribbon example is included). And I’m always interested in what you think about it, so drop a comment or mail.
Posted in 3D, Actionscript, Experiments, Flash 9, Source | 21 Comments »
Derived from one of my older experiments: Three different populations of fireflies are fighting for their survival. If a firefly encounters an enemy fly, it tries to convert it to their tribe. The converted fly looses lifepoints and eventually dies during conversion. For the “collision logic”, I used a slightly modified version of Grant Skinners AS3 Proximitymanager. You can download the source and play around with it here (but don’t expect beautiful code ;)).
Posted in Experiments, Flash 9, Particles, Simulations, Source | 6 Comments »
Just a quick test with the AS3 port of the Box2D Physics Engine … it’s quite fun to play with, I could toss around boxes for hours ;)
Posted in Experiments, Flash 9, Simulations | 2 Comments »
There was this touchscreen in my office, so I had to play around with it and started one of my older experiments on it:
Posted in Experiments, Flash 9, Particles | 4 Comments »
As you noticed, I’m building a small arcarde shooter in AS3 besides my daily work. It started as a small test and got me ;). In my previous post I used getObectsUnderPoint for a hittest between the shot and the enemyclips, this works fine if you don’t need a collision reaction and the clips travel at a moderade speed. Now I wanted to integrate a collision detection and reaction for the enemies and made use of some nice scripts I found out there:
A shape-based collision detection for bitmaps by Grant Skinner, since the third parameter in hitTestPoint(x:Number, y:Number, shapeFlag:Boolean) only works for vectorimages and I’m using bitmaps as graphics. A Proximity Manager. This small class comes really handy and the principle is so simple. The proximity manager splits the stage into grids and stores for every sprite in which grid they are. So you don’t need to test every sprite against all other sprites, instead you just say: “Give me all neighbours of that sprite”, which saves a lot of loops.
So I had the tools for a nice collision detection, for the collision reaction I converted a simple snooker algorithm to AS3: Snooker Balls. Watch the result:
Move your mouse over me!
Posted in Actionscript, Experiments, Flash 9 | 4 Comments »
Ok, AS3 can render thousands of particles per frame… but what if we want more than a few single moving pixels and hittests? So I started to write a small test, instancing bitmaps on random locations. And hey: These objects look like bombs, now I need something to destroy them … and there was the battleship ;). For the hittest I used getObjectsUnderPoint. It seems like this method is a bit slower than hitTest or hitTestObject, but you can actually save a lot of loops because you don’t need to test each bomb with each shot. Instead of:
// pseudo code for each(bombs) { for each(shots) { if(bomb.hitTestObject(shot)) { // shot hit bomb... } } }
you go:
// pseudo code for each(bombs) { var objects:Array = shotClip.getObjectsUnderPoint(bomb.x, bomb.y); if(objects.length) { // shot hit bomb... } }
This only works, if you have a seperate clip for the shots. Enough of the talk: Launch!

(Move using the mouse and rotate the gun with cursor keys)
Posted in Actionscript, Flash 9 | 2 Comments »

Just a small test with my 3D Engine, the idea obviously is “slightly” adapted from the latest Flash Player 10 (Astro) presentation at MAX Chicago, but you don’t need the Flash Player 10 for this ;) Launch!
(I’m still working on the engine API, when I’m satisfied with it, I will release the sources)
Posted in 3D, Experiments, Flash 9 | 1 Comment »

Just another test with additive Colors. Klick mouse to cycle through the different coloring modes: Launch!
Posted in 3D, Experiments, Flash 9 | 5 Comments »

Now my engine supports additive colormixing. It’s slowing the framerate down a bit, at least it looks cool ;) Press space to toggle between additive and normal rendering: Launch!
Posted in 3D, Experiments, Flash 9 | 1 Comment »

My Engine is evolving slowly. Features so far:
I prepared a little Spacescene Demo. A Mouseclick changes the camerafollow between the two ships. The Mousewheel zooms in or out of the scene. Launch!
Posted in 3D, Experiments, Flash 9 | 3 Comments »

My first try with the new AS3 sound classes (SoundMixer.computeSpectrum). This test measures the average sound energy, triggers an event if the energy changes and emits a particle. The particles are 2D particles generated with my 3d Engine: Launch!
Posted in 3D, Experiments, Flash 9, Particles, Sound | 3 Comments »

I’ve been working on my little 3D Engine in the last weeks. Thanks to Andre Michelle’s great Examples I could manage to get the texture mapping to work and integrated a ASE Parser to load meshes from 3d programs. You can draw onto the texture and see the result in the 3d View: Launch!
Posted in 3D, Experiments, Flash 9 | No Comments »