// you’re reading...

3D

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.

Discussion

12 comments for “FIVe3D Cheat Sheet: The Display Classes”

  1. really cool. might try this out this weekend. looks and RUNS pretty good.

    This will help me get started
    cheers

    Posted by Juan Bermudez | May 27, 2008, 12:38 pm
  2. 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.

    Posted by Angel Romero | May 27, 2008, 1:17 pm
  3. @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.

    Posted by Zack Jordan | May 27, 2008, 1:28 pm
  4. thanks dude…. nice reference guide!

    Posted by jonathan greene | May 27, 2008, 2:54 pm
  5. 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.

    Posted by Zack Jordan | May 28, 2008, 11:01 am
  6. 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…

    Posted by Andy | May 30, 2008, 3:17 pm
  7. 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

    Posted by ChromeD | June 24, 2008, 10:33 am
  8. 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?

    Posted by Buda | July 16, 2008, 4:51 am
  9. 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!

    Posted by Matthew Fordham | July 18, 2008, 9:12 pm
  10. 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.

    Posted by Zack Jordan | July 19, 2008, 4:43 pm
  11. 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.

    Posted by Skoua | August 1, 2008, 11:54 am
  12. 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.

    Posted by Zack Jordan | August 4, 2008, 6:23 am

Post a comment

Twitterpated