Trying out flash player 10 3d features
Nascom was kind enough to let me spend some work hours investigating the new features of flash player 10. Naturally the first step was to check out the 3d features. I built a quick “testing” environment. Each test is pretty self explanatory, but if that’s not enough, I included some notes attached to each experiment in the flex app. Behold the first 3 tests (but install player 10 first)…
Be sure to drag the vanishing point…

The frame rate is not bad, even with a ton of shapes:

Creating a cube… lookout papervision 

Ok, so the cube was not so impressive due to the “layered” nature of flash player10 3d. I’m convinced that through the “hackish” nature of the flash community, there will soon be enough “clever” implementations that will be small in filesize, but will fool the eye. Remember, these cubes can be created and tweened on the timeline… Here’s a slightly more convincing “wireframe” version :
try out the flash player 10 3d test runner
More tests coming soon. I’ll be posting the code as well.
Tags: 3d, Flash, flashplayer10, flex





October 16th, 2008 at 11:46 pm
Pretty cool insightful tests
About that cube, or any solid convex geometry for that matter, it can be made to render correctly pretty easily with FP10 tho. Since you have all 3 rotation angles for any surface, you can calculate the normals and set the surface to invisible if it’s pointing away from the eye.
October 17th, 2008 at 12:33 pm
Where do I start…
With regards to tests with multiple faces (Performance3DTest1 and CubeTest):
First you need to add a sorting mechanic in order to remove the ‘optical illusion’ as you call it. Flash doesn’t sort the scene for you. The order that the objects are drawn in the scene is based on the initial order that you add them. Any time you change a 3D position or rotation of an object (by rotation, I mean with respect to the scene… not the individual objects) you have to resort the scene. That means you need to change the index (or depth as it used to be called) of each object since one may have moved behind another (in this case I mean the Z value). Here’s the catch… although it’s true that Z is positive into the screen and negative away from the screen… the index work opposite of that. Smaller index values are into the screen and higher index values are away from the screen. I’m not sure if and how you’re keeping track of the objects, but say you use an array, you can write a custom sort function and call yourArray.sort(customSortFunction) to do that for you.
With regards to the CubeTest:
Apply what the previous comment mentions and only half of the cube sides need to be shown on the scene. The other half that doesn’t need to be shown, (assuming you add the sorting mechanic) you won’t be able to see anyways since the normal will be facing away from the screen so there’s no point of showing them anyways.
Are you using the hardware acceleration feature? Just curious because the frame rate is very jumpy. Your test application doesn’t show an averaged frame rate so its hard to see… but watching it in a 10, 10, 10 (1000 shapes) test on the Performance3DTest1 and keeping a rotaiton active, I can see it ranging from sub-20 to a bit over 30 or so (and occasionally going over 40, and I think I saw something in the 50’s a few times too when not rotating).
Also… 10 x 10 x 10 is 1000 shapes (not sure if you’re just using square shapes or 2 triangles like normal 3D rendering applications do) but 1000 shapes isn’t even close to ‘a ton of shapes’ in a 3D rendering environment. I tried 100 x 100 x 100… which is 1,000,000 (a million) shapes… but that crashed my brower completely.
An ‘ok’ first look at 3D in flash player 10… I say ok… because I’ve done all of this in flash player 7 by writing a software renderer all in AS2, including the perspective texture in your first test. Ya as in seven. I was expecting a lot more from this flash player 10 and I’m overall dissapointed. Just shows how far flash still needs to go to be a 3D renderer.
Either way… nice tests, make some stress tests that won’t crash the browser… I’d curious to see what the new flash player can handle. Sweet testing environment though.
October 17th, 2008 at 5:10 pm
Thanks for commenting jabek. I’ll admit this post was a bit of a rush job before going travelling. The idea was to test the ‘out of the box’ features, just to see what the API looks like and how things behave by default. Nothing fancy here. You’re right about the ‘ton’, I guess I was a bit giddy at the ease of use implemented by the adobe guys. Damn it’s hard to write this shit on a gsm
November 16th, 2008 at 5:55 pm
[...] 10 there is no depth sorting of 3d objects. You are on your own to create that logic. Here is a post that does a better job of demonstrating what I am talking about. So with the limitations in mind [...]
January 2nd, 2009 at 12:38 am
On the Performance3dTest1 it says if you run over 5000+ objects your browser will crash…I ran 66 x 66 x 66 which means i got 287,496 objects…anything above that made my browser crash…i was on Firefox 3.0.5 on Leopard 10.5.6…Flash 10…2 GB ram…2.5 GHz Intel Core 2 Duo…GeForce 8600M GT 512 MB vram