FIVe3D Cheat Sheet: The Display Classes
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.
Tags: 3D, Actionscript, cheat sheet, FIVe3D
May 27th, 2008 at 12:38 pm
really cool. might try this out this weekend. looks and RUNS pretty good.
This will help me get started
cheers
May 27th, 2008 at 1:17 pm
Sweet! Thanks for taking the initiative on creating a helpful cheat guide. This will certainly help as I get my feet wet with this new 3D tool.
May 27th, 2008 at 1:28 pm
@Juan:
Just trying to spread the word, you know?
@Angel:
You’re very welcome. I had to figure this stuff out anyway, and I thought that there were probably those out there who could benefit from my experience. I’ve certainly learned a lot from others doing the same thing.
May 27th, 2008 at 2:54 pm
thanks dude…. nice reference guide!
May 28th, 2008 at 11:01 am
Thanks. I’m still looking forward to the official docs; I think they will probably contain a great many things that I haven’t figured out yet.
May 30th, 2008 at 3:17 pm
Your tutorials are very helpful!
But one thing in FIVe3D keeps me confused. That is how can I use a symbol stored in the library as a Sprite3D?
I tried using Sprite3D as a base class of the symbol, but flash threw me errors while compile. But when I use Sprite2D instead of Sprite3D as a base class, it can compile and everthing ok although there is no rotationX/rotationY etc…
June 24th, 2008 at 10:33 am
Nice Tuts here, but I have one Problem … I studied your CubeDemo, but how can i put one Bitmap (Size is 300×300 px and it is in my Library) in my Enviroment?? If I use BitmapData i got sum errors … Any hintz??
thanx in advacne
July 16th, 2008 at 4:51 am
Having the same problem as Andy here. Can’t seem to get a clip from the library into a Sprite3D. I can set the base class as Sprite2D but then I don’t get rotationX etc attributes. If I use SPrite3D as base it throws errors about missing parameters. Grrr
Any one have any ideas?
July 18th, 2008 at 9:12 pm
Great Resource, thanks!
I will echo Andy’s question however… does anybody know how to attach a MovieClip from the library as a Sprite3D??? Thanks!
July 19th, 2008 at 4:43 pm
I haven’t done much with clips from the library yet, but I’m pretty sure you can’t attach them to Sprite3Ds because they lack the 3D drawing capabilities of a true Sprite3D.
You may need to experiment with the Bitmap3D class instead- see Mathieu’s cube demo on the FIVe3D site.
August 1st, 2008 at 11:54 am
Hey man,
thanks a lot for this article really usefull for my work.
I think pixelwelders’s the best site about Five3D I found during my loo-ong researchs for help on Google.
To answer to earlier posts, I don’t think it’s possible to link home-made MCs to Sprite3D. Five3D only let us use the Bitmap3D class.
August 4th, 2008 at 6:23 am
Hey, thanks Skoua; that’s pretty encouraging. People have told me I spend too much time with it, but I’m glad to know that it benefits someone.
July 12th, 2009 at 1:38 am
Does anyone know how to add a width and height value to a Sprite3D. Right now the Sprite3D does not allow to get the width or Height.
Also to answer some of the above questions. FIVe3D does not support adding library MovieClips directly to a Scene or a Sprite3D. You have to use the Bitmap3D class which turns your library MovieClip into a bitmap so it looses the interactivity. Great classes but not having MovieClip interactivity it really is a huge work around to everything.
August 10th, 2009 at 2:11 am
Had anyone tried to implement custom made components (think slideshow pro) into five 3d?
September 12th, 2009 at 4:42 am
[…] battling with FIVe3D, this cheat sheet by Zack Jordan might be useful var addthis_pub = ‘felisan’; var addthis_language = ‘en’;var addthis_options = […]
September 12th, 2009 at 4:44 am
great post once again, Zack!