I've attempted the following code but there is still a flip when passing -90
& 90.... Seems upAxis change from 0,1,0 to 0,-1,0 doesn't do anything? Bug?
Code will be released for all once worked out.
private var upAxis:Vector3D;
public function hover():void
{
if (tiltAngle != _currentTiltAngle || panAngle != _currentPanAngle)
{
_currentTiltAngle += (tiltAngle - _currentTiltAngle)/(steps + 1);
_currentPanAngle += (panAngle - _currentPanAngle)/(steps + 1);
}
upAxis = (isflipped())? new Vector3D(0,-1,0) : new Vector3D(0,1,0);
var gx:Number = target.x +
distance*Math.sin(_currentPanAngle*toRADIANS)*Math.cos(_currentTiltAngle*toRADIANS);
var gz:Number = target.z +
distance*Math.cos(_currentPanAngle*toRADIANS)*Math.cos(_currentTiltAngle*toRADIANS);
var gy:Number = target.y +
distance*Math.sin(_currentTiltAngle*toRADIANS)*yfactor;
var msg:String = "";
msg = "upAxis = " + upAxis;
msg += " tiltAngle = " + Math.round(tiltAngle);
msg += " panAngle = " + Math.round(panAngle);
msg += " _currentTiltAngle = " + Math.round(_currentTiltAngle);
msg += " _currentPanAngle = " + Math.round(_currentPanAngle);
msg += " gx:" + Math.round(gx);
msg += " gy:" + Math.round(gy);
msg += " gz:" + Math.round(gz);
trace(msg);
x = gx;
y = gy;
z = gz;
this.lookAt(target.position,upAxis);
}
public function isflipped():Boolean{
var normalTilt:Number = Math.abs(_currentTiltAngle)%360;
return (normalTilt >= 90 && normalTilt <= 270);
}
On 12 June 2011 23:46, Darcey Lloyd <[email protected]> wrote:
> Hi all,
>
> Anyone got an unrestricted tilt version of HoverCamera3D for Away3D 3.6?
>
> Thanks
>
> Darcey
>