Mar042009
There’s a new competition going on at TIGsource called the “Cockpit Compo,” wherein the design constraint is using a cockpit (or similar HUD). I doubt that I will have time to actually make an entry, but since I’m using Actionscript/Flash as my language/platform of choice now-a-days, I’m trying to look into a 3D library for Actionscript. Papervision3D seems like a favorite, so my next step is to find some tutorials and give ‘em a shot. First, though, we have to figure out how to actually compile projects with Papervision.
1. Obtain the (free) Flex SDK, and put it somewhere in your system path. I wrote a post about setting up your Actionscript development environment; check it out if you haven’t done this already.
2. Download the Papervision3D compiled library (.swc) or source (.as). It doesn’t really matter which one, as I will explain how to use ‘em both.
3a. If you got the .swc, put it in the same directory as your project files and rename it to ‘papervision3d.swc’. When you compile, add the flag -include-libraries papervision3d.swc. That’s it!
3b. If you got the .as source, extract it and put the ‘/org’ directory in the same directory as your project files. Compile as normal, you don’t need to feed mxmlc any extra flags.
To test out the process, get the “Simple HelloWorld Example for Papervision3D 2.0″ .zip that’s on the Papervision3D downloads page. Drop in the .swc or the /org directory (depending on what you downloaded), then compile using the instructions above. I got the .swc, put it in a subdirectory called ‘/libs’ within the /src, and compiled with mxmlc Main.as -include-libraries libs/papervision3d.swc. If everything goes the way it should, a .swf will be produced that displays a crazily-textured spinning sphere.