What happends if you export from Prefab as AS3 for AwayLite?

Fabrice


On Sep 22, 2010, at 4:33 PM, savagelook wrote:

> In the latest trunk of away3dlite I can't get a 3ds model to appear on
> the screen.  I tested the model in Prefab and its loads fine in
> there.  I created a bare bones project to try and get it to work with
> no success.  Here's the code:
> 
> package
> {
>       import away3dlite.containers.ObjectContainer3D;
>       import away3dlite.containers.View3D;
>       import away3dlite.loaders.Max3DS;
>       import away3dlite.materials.ColorMaterial;
> 
>       import flash.display.Sprite;
>       import flash.display.StageQuality;
>       import flash.events.Event;
> 
>       [SWF(frameRate="60", height="600", width="800")]
>       public class away3dlite_3ds extends Sprite
>       {
>               [Embed(source="cLarBodM.3DS", 
> mimeType="application/octet-stream")]
> private var _guitar:Class;
> 
>               private var _view:View3D;
>               private var _max3ds:Max3DS;
>               private var _model:ObjectContainer3D;
> 
>               public function away3dlite_3ds()
>               {
>                       if (stage) {
>                               _init();
>                       } else {
>                               this.addEventListener(Event.ADDED_TO_STAGE, 
> function(e:Event):void
> { _init(); });
>                       }
>               }
> 
>               private function _init():void {
>                       stage.quality = StageQuality.LOW;
> 
>                       _view = new View3D();
>                       _view.x = stage.stageWidth/2;
>                       _view.y = stage.stageHeight/2;
>                       _view.camera.z = -500;
>                       this.addChild(_view);
> 
>                       _max3ds = new Max3DS();
>                       //_max3ds.material = new ColorMaterial(0x000000);
>                       //_max3ds.scaling = 100;
>                       _model = _max3ds.parseGeometry(new _guitar()) as 
> ObjectContainer3D;
>                       _view.scene.addChild(_model);
> 
>                       this.addEventListener(Event.ENTER_FRAME, _onEnterFrame);
>               }
> 
>               private function _onEnterFrame(e:Event):void {
>                       _view.render();
>               }
>       }
> }
> 
> Am I doing something obviously wrong here or is there a problem with
> away3dlite?  I tried toying with the material and scaling, but they
> didnt help either.  I'm stuck, any ideas?

Reply via email to