Awa3d 2.2: Sierpinski Turtles
3d Flash, Away3d code demos September 29th, 2008Away3d 2.2 is now released! So it is time to start dipping into the new features available, and demo some of what’s on offer.
One of the biggest new features in 2.2 is triangle caching. This is a way to speed up scenes with static cameras, and (some) static content. The demo above shows how Away3d can now handle around 50,000 polys rendered to screen without too much hassle, while maintaining interactivity and framerate. This is accomplished by automatically detecting when a triangle mesh require redrawing, and skipping that step when it isn’t required.
You can view the turtles from any angle, but in order to maintain framerates while moving around, a wireframe model is swapped in from the point the camera starts moving. Once things are static again, triangle caching automatically kicks in. The beauty of this feature is that it will work on your existing Away3d applications without any modifications – if triangle caching can be employed, Away3d will use it!
Source code is available here, or in the right-click menu of the demo. The use of ownCanvas in the source is something to note – it essentially allows boundaries to be defined for different areas of caching in a scene. When an object has it’s own drawing canvas with ownCanvas enabled, it has it’s own caching routine that updates separately to other areas of the scene. So if you have a definite separation between objects that are static and objects that move (or in this case have their materials updated), enabling ownCanvas on a moving object will ensure only that container has a redraw triggered, allowing the rest of the scene to remain cached and keeping framerates high.
More demos of the new features of Away3d 2.2 should be arriving here soon. In the meantime, check out the latest svn source or visit the Away3d downloads page for zip files.











October 21st, 2008 at 7:09 pm
Thanks for the excellent model of the SierpinskiTurtles .
I found that this was a error at the SierpinskiTurtles Class,which is located at Line 228 : CloneAll function .
October 22nd, 2008 at 5:35 pm
Hey maomao
this may be a discrepancy between the current zipfile code for 2.2 and the trunk code of the svn repository. I will be updating the zipfile soon with the bugfixes made after the initial release, but in the meantime the latest svn code should give no errors
July 20th, 2009 at 8:12 am
hi rob i was wondering about somtehing, in this case why it wasnt neccesary the ZOrder?
July 20th, 2009 at 8:13 am
and wheres a good tutorial to pass the animations to AS3, i havent found one, only ho w to pass models.
August 4th, 2010 at 2:18 am
You can see the blue turtle even when it is behind another. Is there a way to use a z-buffer so that a moving triangle can be occluded if it moves behind something?