mx3d : Flash MX 3d Component System

mx3d is a set of Flash MX components that create, transform, and display three dimensional geometry using Euler angles. mx3d takes advantage of (and demonstrates) the power of using components to create modular applications in Flash. mx3d is free for you to use any way you want, including for commercial applications. The only restriction is that you may not take mx3d and sell it without making significant improvements or changes (not that anyone would buy a spinning cube anyway, but still, I gotta put that part).

example

This example shows the mx3d system in action. The display is rendered by an engine component, the cubes were created by a geometry generator component and the motion comes from a rotation controller component.

NOTE: The example requires the Flash 6 Player.

news

[9/20/02] I've heard from some folks over in France that Macromedia has been showing this component at the Apple Expo in Paris. I'm a bit embarassed, since neither the math nor the programming style of this stuff are particularly good. Still, if it helps anyone, I've posted an example showing a few more of the things you can do with mx3d. Perhaps someday I'll make this thing work better, but let's be realistic -- I haven't touched it in about 6 months. Maybe if someone has a really compelling use case...

[4/7/02] Version 1.0.2 : added documentation. I hope the code hinting and reference panel entries make it easier to use mx3d. Also, I built a new mouse-driven rotation controller. This shows the power of using a component system in Flash MX: you can just drop this new controller into your movie and it will control the existing mx3d engine.

[4/6/02] Version 1.0.1 : added an option to the mx3d component parameters for clipping lines and movie clips to the viewport of the engine. Also added a parameter to control the amount of perspective. Added a new pad-driven rotation controller, similar to the button-driven controller, but works with mouseovers (no clicking necessary). Fixed a bug with the clearLines and clearPolys functions.

[4/3/02] Version 1.0 released. Includes mx3d engine, button-driven rotation controller, preset-driven rotation controller, and geometry generator components. In the works: clipping, depth-sorting, and efficiency improvements.

download + install

To install these components, you need the Macromedia Extension Manager 1.4, which you can download from the Macromedia Exchange for Flash site. (And, of course, you need Flash MX.) Once you install mx3d, it will be available from the Components Panel.

mx3d-102.mxp (28 kbytes)
NOTE: you have to save this file to your hard drive before installing it. (On Windows, right click and "Save Target As...", on Macintosh, control-click and "Download Link to Disk" or something along those lines.) Then run the Extension Manager, select "Install Extension...", and select the file you just saved. If you try to install it without saving it first, the Extension Manager will give you an error.

quick start

After you install mx3d, open up the Components Panel and try this:

1. Drag an mx3d onto the stage, and name it mx3dInstance.
2. Drag an mx3dControlPreset onto the stage.
3. Drag an mx3dGeometryGenerator onto the stage, and name it geom.
4. In frame one of the main timeline, add the following ActionScript:

center = new point3d(0,0,0);
geom.addCube(center, 40, 0xFF0000);

5. Publish Preview or Test Movie to see the results.
6. Experiment! Try using an mx3dControlPad or mx3dControlMouse instead of the mx3dControlPreset.
Try adding different kinds of geometry. Test out the different parameters of each component. You'll find documentation in the Reference Panel.

feedback

I would love to know what you think of mx3d, how you use it, and how it could be improved. And, of course, please let me know about any bugs you find.

ben@benchun.net

credit

This project is inspired by work I have been doing with my friend Sam Torrisi. Thanks to Brandon Williams for his great work laying down a very simple and clear explaination of the math behind 3d geometry, and to Gary Grossman for making sure we had all the necessary tools to be able to make Components in the first place.

This is not the first Flash MX 3d engine, nor is it the best. To the best of my knowledge, Stuart Schoneveld created the first one, along with some other very nice components.