By the time I wrote this post, Away3D4 was still in alpha version. Unlike Away3D 3.X, there was no Metaseq parser/loader available π That’s not a problem since we can export MQO 3D model to OBJ using Metaseq itself. The problem is the export settings can be tricky and take some trials-and-errors to get it right.
Here’s what I did to export my MQO model to OBJ:
- It’s better that you remove unnecessary layers like bone and anchor. Save your model as other file and remove those unnecessary layers.
- Leave the size to 1.0
- Away3D use different axis than Metaseq, we need to convert our module axis.Choose the axis to POV-RAY, this is the one that compatible with Away3D
- Select the UV mapping and also select Invert V
- Export Normal Vector and Grouping
- You can export Material Library, which means Metaseq will export OBJ and MTL file. Since I prefer to embed my textures inside my SWF file, I uncheck this options and will assign the textures/materials later using ActionScript.
If you have Flash Player 11 installed on your browser, you can click the image below to see the demo of loading OBJ exported for MQO.
Download the source code hereΒ (including MQO, OBJ, and FlashDevelop 4 project files)
It gives me an error on this line
_dudeLoader.parseData(OBJData, null, new AssetLoaderContext(false));
The error is
col: 16 Error: Call to a possibly undefined method parseData through a reference with static type away3d.loaders:Loader3D.
_dudeLoader.parseData(OBJData, null, new AssetLoaderContext(false));
Thanks for the feedback. There’s a lot of changes in Away3D 3.X.X since this post. I’ll update the code accordingly soon π
Sorry, my code still used the old Away3D4. I forget since when, Away3D changed some of their methods’ name. I’ll update the code accordingly soon.
Thanks for the feedback!