Posts Tagged ‘cheat sheet’

FIVe3D Cheat Sheet: The Display Classes

Tuesday, May 27th, 2008

As should be obvious, I’ve been pretty fascinated with Mathieu Badimon’s elegant little 3D vector engine FIVe3D for some time now:

Experiments in the Third Dimension: FIVe3D
FIVe3D and TweenLite: Text Cloud
Best FIVe3D Experiment Yet
FIVe3D TextCloud: AS3 Tutorial and Source

And as I’ve mentioned, FIVe3D is in my opinion the easiest Flash 3D engine to pick up and play with. In my tutorial above (link #4), I am able to get a little demo running in just a few lines of ActionScript. However, my tutorial only covers the DynamicText3D class (and to a lesser extent, the Sprite3D class). Thus, as a companion work, I’ve put up a quick summary and comparison of the FIVe3D display classes below. Hopefully this will help tide a few people over until Mathieu releases the real documentation (which will certainly be much more exhaustive than my little effort).

Display Classes

Class Extends Description and Notes Dispatches MouseEvents?
Scene3D Sprite This is the base display class for the FIVe3D display list. It corresponds to the Stage in the normal Flash display list. Put simply, if it ain’t on here, it ain’t getting rendered. Yes
Graphics3D N/A This is the FIVe3D equivalent to the AS3 Graphics class. All FIVe3D display objects (with the exception of Scene3D and Sprite2D) have one, with the instance name of graphics3D. It has many of the same methods as the normal Graphics class, and you can also send an instance to the Drawing class if you want to draw additional shapes. Take a look at the example that comes with FIVe3D to see this in action. N/A
Shape3D Shape This is as basic (and as lightweight) as FIVe3D gets. Sprite3D and Shape3D share the same relationship as Sprite and Shape in AS3: both have a Graphics3D instance for drawing, but Shape3D is non-interactive and cannot have children. No
Sprite3D Sprite Just like a Sprite, but in three dimensions. Unlike Shape3D, this class can have children, each of which adopts its parents’ positions and rotations. It is also interactive. Yes
Sprite2D Sprite Sprite2Ds may be placed in three dimensions (that is, they have x, y, and z coordinates), but they can only rotate around the z axis. In other words, they’re just like normal Sprites with a “z” coordinate. Also, Sprite2Ds do not have a graphics3D object- just the plain old graphics. This means that you can’t use the methods in the Drawing class with this (unless you tweak the Drawing class). Yes
DynamicText3D Sprite3D This is a Sprite3D that displays font glyphs. Think of it as a 3D TextField. You can set the size, color, font (”typography”), and letter spacing. Fonts are kept in the typography package. Yes
Bitmap3D Shape This is analogous to a Shape3D that displays Bitmaps instead of vector graphics. Take a look at the Earth Cube source for an example of this in action.

No
Video3D Bitmap3D Video3D is a dynamic Bitmap3D, and a shell for a Video object. Just like a Video instance, you can use attachNetStream() or attachCamera() to set the video source. No

So let me know if this is useful to you- or if not, what would make it useful (more examples? benchmarks?). Hopefully it will at least give a little clarity to those who are curious about this engine.