The classic question on interviews lately is "What would you ask Adobe to improve on the Flash player?". Well, I finally have a real thing to ask the guys and is to give some love to graphics.beginBitmapFill.
Since the beginning there were 2 ways of rendering your 3d scene in flash.
1. Render everything in a single Sprite / MovieClip. 2. Create a Sprite / MovieClip for each triangle or Mesh.
The second option was the most useful because you had easily properties such as opacity and even blending as Sprite/MovieClip have already those properties, but, performance-wise, option 1 was the winner hands down. So, as people wants speed, some engines have gone through the option 1 and then spent time trying to find ways to hack the properties that you get for free with option 2.
If you take a look on the drawTriangle loop inside Papervision3d in instance you'll find this:
I even had to do a hack for a project where in order to be able to change the opacity of one material dynamicaly I had to generate an array of bitmapDatas with the original texture with different levels of transparency... nasty!
Wouldn't it be great if you could tell the amount of opacity and which blending to use to the beginBitmapFill?
I'm finding this code.google thingie quite handy for handling all my open source stuff. Recently I've updated the videoplayer quite a bit and I was now updating the pv3d previewer...
So, keep an eye on the link cos it will be heavily updated (specially the svn repository) from now on:
There was a guy on escena.org yesterday talking about this pong in 1kbytes done in openGL. So, once again, I felt challenged and tried to do the same with Actionscript 3.
And well, after a bit of tweaking here and there, seems like managed to make it in 1,022bytes :D
You know where the sources are, don't you? But if you just want to see the snippet, here it's too.
EDIT:Kristof Neirynck has ported the code to AS2, and after a few tweaks turns out that AS2 creates tinier files than AS3. At least in this case. pong0.5k Maybe when going a couple of kbytes up AS3 would win AS2.
EDIT 2: And now, for something completely different, the same game in 393bytes. Nice one Matthew! :D