viewport not visible but working?

Software: Away3D 4.x

view, Newbie
Posted: 07 March 2012 11:47 AM   Total Posts: 12

Hi Everyone, I have just ported an existing away3d project to broomstick, the speed for me are at least 10 x quicker so great job. I have tested it on its own in Flash Builder and renders as expected. I have to now moved that into a separate class and when compiled there seems to be no viewport visible but all the traces and loaded objected are working fine.
The _view.backgroundColor is not visible either? I thought it may be a view size issue but it traced at the size of the stage. Has anyone had this issue before or am i over looking something basic? The stats added to stage shows fine, which makes me think it must be a viewport / scene thing.

I import mainView2 which uses away3d.

mainView2 basic set up looks like

private function setupAway3D4():void{
   
// Setup scene
   
_scene = new Scene3D();
   
   
// Setup camera
   
_camera = new Camera3D();
   
_camera.lens.far cameraViewDistance;

   
   
_view = new View3D();

   
_view.backgroundColor 0x666666;
   
_view.antiAlias 4;
   
_view.scene _scene;
   
_view.camera _camera;
   
_view.mouseEnabled true;
   
_view.mouseChildren true;
   
trace("VIEW"_view.x_view.y_view.width_view.height_view.visible_view.alpha);
   
   
container = new ObjectContainer3D();
   
   
_scene.addChild(container);
   
_camera.lookAt(container.position);
   
   var 
tr:Trident = new Trident(500,true);
   
_scene.addChild(tr);
   
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
   
// Setup a HoverController (aka HoverCamera3D in older versions of Away3D)
   
cameraController = new HoverController(_cameranull150102000);
   
addChild(_view);
   
// Show Away3D stats
   
stats = new AwayStats(_view,true);
   
stats.5;
   
stats.5;
   
this.addChild(stats);
   
   
Parsers.enableAllBundled();
   
assetLoaderContext = new AssetLoaderContext();
   
_loader = new Loader3D();
   
_loader.addEventListener(AssetEvent.ASSET_COMPLETEonResourceComplete);
   
_loader.load( new URLRequest('daeModel/myModel.obj'),assetLoaderContext);
  

i then clone the loaded obj file and add it to a container.
Its not stacking issue as view is on top. It only happens when I put it into an external class.


Any help appreciated.

w

   

view, Newbie
Posted: 07 March 2012 12:00 PM   Total Posts: 12   [ # 1 ]

hold on people, I think it may have found the issue and could be an embarrassing newb issue!:red:

   

bardo, Member
Posted: 07 March 2012 01:18 PM   Total Posts: 79   [ # 2 ]

have u added the external class to Display list? are u targeting FL player 11 on compile? if u change the color bacground of the view, do u see the new color?have u added _loder mesh to scene?

   

view, Newbie
Posted: 07 March 2012 02:09 PM   Total Posts: 12   [ # 3 ]

Thanks for your help, I have now resolved it. For some unknown reason the stacking order of the classes shuffled, I had a filled sprite as a background colour at index 0 in the main class, the viewport seems to add behind it. I have removed the sprite and added a colour to the viewport and all is looking as it should. I must have been looking at it too long! cheers

   

bardo, Member
Posted: 07 March 2012 02:14 PM   Total Posts: 79   [ # 4 ]

Stage 3 d is always at lower index thane regular stage

-stagevideo [....]
-stage3d[——]
-STAGE!

if understand the new stack properly ... smoetimes i feel like not.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X