Problems with Flash Builder 4.6 and Latest Away3D - black shape over screen

Software: Away3D 4.x

Beek, Member
Posted: 12 March 2014 11:57 PM   Total Posts: 67

I’ve got a very annoying problem with Flash Builder 4.6 and Away3D, well it’s now kind of 2 problems.

We’ve got a web/mobile panorama product that uses Away3D to render the panoramas as a skybox.

I recently updated Away3D to the latest version, and found that on mobile, there is a black shape in the middle of the screen, blocking part of the panorama. It seems to start off as the whole screen, and then as you rotate it shrinks and changes shape covering the centre of the panorama. The hotspots that are over the skybox are fine.

I tried reverting to our previous version of Away3d, and now Flash Builder thinks it’s full of errors such as invalid overrides and classes not found, and won’t compile any new changes to the project. Eg -overridesaway3d.materials.methods.BasicDiffuseMethod.applyShadow -1020: Method marked override must override another method.

So really, there’s 2 problems here:

- Latest version Away3D makes black shape on Mobile App
- Flash Builder won’t accept the previous version of Away3d code (which has been fine for ages).

Can anyone shed any light on either issues so I can get back on with it?


EDIT

To continue progress, I’ve decided to use the latest version and develop the desktop version. So if anyone is able to help with the black shape on the mobile version, I’d appreciate it.

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 13 March 2014 09:29 AM   Total Posts: 669   [ # 1 ]

What it looks like is that the lens.far parameter is being exceeded, causing clipping of the corners of the box. However an actual skybox should be rendered regardless of that parameter. Just something to try smile

The error output might suggest you have 2 different versions both in the global or project class path. Make sure you only have one.

Good Luck!

 

   

Beek, Member
Posted: 17 March 2014 01:35 AM   Total Posts: 67   [ # 2 ]

Thank you MightyAtom,

You are indeed right, and we’d exceeded the lens.far parameter. I’ve dropped it from 100,000 to 5,000 and it’s showing the whole image.

Which leads me to why we set it to 100,000.

We have hotspots floating in the scene, which are placed using this code:

private function addHotspot(data:HotspotData):void
  {
   
var hotspot:Hotspot createHotspot(data);
   if(!
hotspot)
    return;
   
   
updateHotspotPosition(hotspotdata);
   
   
hotspot.mouseEnabled true;
   
hotspot.hidden Model.gameRevealsHotspot(data) || (Model.guideScene && Model.guideScene.isHidden(data));
   
hotspot.addEventListener(MouseEvent3D.MOUSE_DOWNonHotspotMouseDown);
   
hotspot.addEventListener(MouseEvent3D.MOUSE_UPonHotspotMouseUp);
   
   
scene.addChild(hotspot);
   
hotspotDataToMesh[data] hotspot;
   
   
data.addEventListener(HotspotData.ORIENTATION_UPDATEDonHotspotOrientationUpdated);
  
}


 
private function updateHotspotPosition(hotspot:Hotspotdata:HotspotData):void
  {
   hotspot
.rotationX data.rotationX 90;
   
hotspot.rotationY data.rotationY;
   
   var 
distance:Number Math.min(data.distance hotspot.distanceRatio2000);
   var 
pr:Number = -* (data.panoPos.pan 90) * MathUtil.TO_RADIANS;
   var 
tr:Number data.panoPos.tilt MathUtil.TO_RADIANS;
   
   
hotspot.distance Math.cos(pr) * Math.cos(tr);
   
hotspot.distance Math.sin(tr);
   
hotspot.distance Math.sin(pr) * Math.cos(tr);
   
hotspot.scaleX hotspot.scaleY hotspot.scaleZ hotspot.distanceRatio;
  

We did this because they’re moving when the camera moves, and to combat this we hacked it by setting them really far away and really big.

Now I’ve reduced the lens.far parameter and the hotspot distance, they’re moving around again as you pan around the scene.

Is there a less hacky way of getting them to stay still?

 

   

Beek, Member
Posted: 17 March 2014 01:36 AM   Total Posts: 67   [ # 3 ]

Thank you MightyAtom,

You are indeed right, and we’d exceeded the lens.far parameter. I’ve dropped it from 100,000 to 5,000 and it’s showing the whole image.

Which leads me to why we set it to 100,000.

We have hotspots floating in the scene, which are placed using this code:

private function addHotspot(data:HotspotData):void
  {
   
var hotspot:Hotspot createHotspot(data);
   if(!
hotspot)
    return;
   
   
updateHotspotPosition(hotspotdata);
   
   
hotspot.mouseEnabled true;
   
hotspot.hidden Model.gameRevealsHotspot(data) || (Model.guideScene && Model.guideScene.isHidden(data));
   
hotspot.addEventListener(MouseEvent3D.MOUSE_DOWNonHotspotMouseDown);
   
hotspot.addEventListener(MouseEvent3D.MOUSE_UPonHotspotMouseUp);
   
   
scene.addChild(hotspot);
   
hotspotDataToMesh[data] hotspot;
   
   
data.addEventListener(HotspotData.ORIENTATION_UPDATEDonHotspotOrientationUpdated);
  
}


 
private function updateHotspotPosition(hotspot:Hotspotdata:HotspotData):void
  {
   hotspot
.rotationX data.rotationX 90;
   
hotspot.rotationY data.rotationY;
   
   var 
distance:Number Math.min(data.distance hotspot.distanceRatio2000);
   var 
pr:Number = -* (data.panoPos.pan 90) * MathUtil.TO_RADIANS;
   var 
tr:Number data.panoPos.tilt MathUtil.TO_RADIANS;
   
   
hotspot.distance Math.cos(pr) * Math.cos(tr);
   
hotspot.distance Math.sin(tr);
   
hotspot.distance Math.sin(pr) * Math.cos(tr);
   
hotspot.scaleX hotspot.scaleY hotspot.scaleZ hotspot.distanceRatio;
  

We did this because they’re moving when the camera moves, and to combat this we hacked it by setting them really far away and really big.

Now I’ve reduced the lens.far parameter and the hotspot distance, they’re moving around again as you pan around the scene.

Is there a less hacky way of getting them to stay still?

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 17 March 2014 07:35 AM   Total Posts: 669   [ # 4 ]

This is a static panorama, right?
Then the only correct position for the camera is in the middle.
How are you moving it? Could you post a link?

Cheers!

 

   

Beek, Member
Posted: 17 March 2014 07:50 AM   Total Posts: 67   [ # 5 ]

Sure. Eg is here http://beek.co/g66 or anything on beek.co

Yes it’s a static panorama player with a hoverCamera at the centre.  We move it with mouse or gyroscope.

Thanks!

This problem only occurs on mobile in Adobe Air. It’s fine in the Flash player.

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 17 March 2014 07:56 AM   Total Posts: 669   [ # 6 ]

they do move around here too.
What I thought was happening was that your far parameter wasn’t far enough, not that it was too far!

As far as the moving hotspots, I think maybe your camera isn’t quite at the center. If your using a target, that the camera points to, make sure it’s right in front of the camera, ie. distance 0.001 or something, in your hover controller. That should keep your hotspots still.

Good Luck! Looks sweet smile

 

   

Beek, Member
Posted: 17 March 2014 08:09 AM   Total Posts: 67   [ # 7 ]

Hmm thanks for that.

I didn’t write this, so trying to work out what’s going on.

This is the basic setup:

// Away3D4 Vars
  
private var scene:Scene3D = new Scene3D();
  private var 
camera:Camera3D = new Camera3D();
  private var 
view:View3D = new View3D();
  private var 
cameraController:HoverController;

                 
cameraController = new HoverController(cameranullpantilt1000); 

I assume the target is the first variable in the HoverController, is this right?

Would it be better to specify a target and set it there? 

 

 

   

Avatar
theMightyAtom, Sr. Member
Posted: 17 March 2014 08:16 AM   Total Posts: 669   [ # 8 ]

Simply reduce the 1000 to something very small. THis is the distance from the camera to the target, which is 0,0,0 unless you specify another one.

 

   

Beek, Member
Posted: 17 March 2014 08:19 AM   Total Posts: 67   [ # 9 ]

Hallej-frickin-lula!!

That’s so awesome and simple. We fought with that particular conundrum for ages.

Star.

 

   

Beek, Member
Posted: 21 May 2014 01:06 AM   Total Posts: 67   [ # 10 ]

Hi, further to the above problem, I’ve still got an issue with a black shape on mobile. Please see attached.

It is now only a triangle in the corners of the skybox, but it is still ugly.

I’ve had to adjust the camera.lens.far and have set it at 3700 to try and find a compromise with the distance required so the shape is minimal, and allowing enough space to place objects at distance inside the scene with a good range (and not getting cut in half as the camera turns).

I’ve tried adjusting the lens.far settings and it goes from a black screen that covers the whole stage, to a small triangle in the corners.

Anyone any idea how to get rid of it?

 

   

John Brookes, Moderator
Posted: 21 May 2014 09:08 AM   Total Posts: 732   [ # 11 ]

https://github.com/away3d/away3d-core-fp11/issues/685

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X