Currently, I am looking into a 3D treatment for a UI in production. Where 3D meets Flash, there are plenty of established third-party 3D engines available from the open source community. To name a few:
Sandy 3d
Five3d
Papervision 3d
Unity 3d
and others...
With the advent of FP 10, Adobe now has their own, not quite 3d option.
2.5D
The Flash 10 3d api is known as a 2.5d option, since it involves perceptual transformations in a 2d environment rather than a bona fide x,y,z coordinate space. Aptly enough, it is also referred to as "Postcards in Space". It is fine for menus and presentations such as the one I'm looking into, where the scope of motion is limited to fixed options.
Planning it out
Putting together a 3d UI adds complexity to an already complex process. Thus it is necessary to break the process down into manageable steps. Here are the general guidelines I am following:
- Bitmapped planar polygons
- in a 2d mesh
- in a display object container
- perspective positioned relative to mouse position.
- Create xml-driven coordinate system to hold masked bitmaps as a 2d display object
- Add each of these 2d display objects as a plane of a 3d cube
- Render cube by mouse coordinates
- create 3d cube
- wire up cube to mouse interaction
- add complex content to faces of cube
First of all, there are different ways to present 3d objects in Flash 10. There is the use of a display object, with its properties of
- rotation x, y and z
- scale x, y and z
- beginShaderFill()
- drawGraphicsData()
- drawPath()
- drawTriangles()
- lineBitmapStyle()
- lineShaderStyle()
Since my UI is effectively a cube with complex objects inside it, the former method will be the best for this effort. Incidentally, have a look at Lee Brimelow's recent tutorial on a Flash 10 API 3d image carousel. It's a good basic intro to the technique. Plus, it mentions a critical point of the implementation, the need to address z sorting. Did somebody say quaternion?
So, containers can use x,y and z positioning data. Furthermore, they may contain nested containers. Moving forward is now possible.