a place to learn, share and develop augmented reality with Flartoolkit
FLARtoolkit is a Saqoosha project | ARtoollkit is a ARtoolworks projet

DOWNLOAD SOURCE
http://www.corelabs.cn/ar/Playing_Animations_ARFighterz.zip
AR FIGHTERS: FLARManaget Multi MD2
* This AS file is based on the FLARManager 0.5 Example_PV3D and the Collada Tutorial from Eric Socolofsky and it has been modified to load and play MD2 models and animations on multiple markers.
* Inspired on the Sunil John's BOBBA FETT + STARSCREAM AR (http://www.suniljohn.com/blog/?p=156)
* THIS CODE IS FULL OF BUGS AND ERRORS, it's an exercise of AS3 understanding by a non expert. Don't expect an elegant coding :)
* FEEL FREE TO CONTRIBUTE TO IMPROVE THIS CODE.
* PLEASE: SHARE ANY IMPROVEMENT ON THE CODE
1. USE
* Print the TWO FIRST patterns in the resources/flar/patterns folder
* Uncomment in the FLARManagerExampleLauncher the line wich contents
// this.addChild(new FLARManager_Multi_MD2());
* Check your models, textures and sounds paths in Simple_MD2.as
* Clean and build the project.
2. FEATURES
* Loads MD2 (Quake) 3D models.
* Debug the animation channels
* Plays the MD2 animation channels and sounds using keyboard events.
* Includes the Saqoosha Cubic Hole effect for each model
* Each time you kick your opponent, the player score increases.
3. KNOWN BUGS
* The pattern recognition sometimes causes the model start an absurd loop and never finish the lift. You have to remove the marker and
put it again in front the camera.
* You have to click inside the flash window to activate the keypress
* As far as the cubic hole is rotated, the textures maps doesn't fit so the textures has to be remapped.
* If you keep pressed a movement key, the model moves but also the animation plays looped from the first frame and doesnt looks good.
* The way the position of each model is calculated (sceneX and sceneY difference) creates a situation where the two models are far away one of each other and the can still kicking their opponent.
UPDATE: the new way uses hitTestObject and doesn't works as espected.
4. KNOWN CODING ERRORS
* I had to load the sounds in the main function before load the models, in other case, I get runtime errors.
* I tried to create the models vars dinamically, but I couldn't, so I decided to reduce the number of models to two and create a "case of" scenario with only two patterns.
The bad thing: the code is soooo long and probably its ofensive to an expert coder. Sorry mates, I'm a AS3 newbe :)
The good thing:
(a).whit this method you can reference the models properties outside the addMarker function and play with them.
(b).I you want to add other model, you only need to copy paste the case code and change the var name.
DOWNLOAD SOURCE
http://www.corelabs.cn/ar/Playing_Animations_ARFighterz.zip
| Attachment | Size |
|---|---|
| AR_FIGHTERZ_snap.png | 152.61 KB |
Recent comments
11 hours 44 min ago
16 hours 37 min ago
1 day 16 hours ago
2 days 10 hours ago
4 days 16 hours ago
5 days 17 hours ago
6 days 14 hours ago
1 week 16 hours ago
1 week 1 day ago
1 week 1 day ago